mirror of
https://github.com/gogrlx/bitcask.git
synced 2026-04-02 02:58:59 -07:00
Auto recovery (#153)
* implement autorepair Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com> * fix misspell Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com> * Update internal/data/recover.go Co-authored-by: James Mills <prologic@shortcircuit.net.au> * Update internal/utils.go Co-authored-by: James Mills <prologic@shortcircuit.net.au> * Update internal/data/recover.go Co-authored-by: James Mills <prologic@shortcircuit.net.au> * skip failing test on windows Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com> Co-authored-by: James Mills <prologic@shortcircuit.net.au>
This commit is contained in:
12
options.go
12
options.go
@@ -14,11 +14,23 @@ const (
|
||||
|
||||
// DefaultSync is the default file synchronization action
|
||||
DefaultSync = false
|
||||
|
||||
// DefaultAutoRecovery is the default auto-recovery action.
|
||||
)
|
||||
|
||||
// Option is a function that takes a config struct and modifies it
|
||||
type Option func(*config.Config) error
|
||||
|
||||
// WithAutoRecovery sets auto recovery of data and index file recreation.
|
||||
// IMPORTANT: This flag MUST BE used only if a proper backup was made of all
|
||||
// the existing datafiles.
|
||||
func WithAutoRecovery(enabled bool) Option {
|
||||
return func(cfg *config.Config) error {
|
||||
cfg.AutoRecovery = enabled
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
// WithMaxDatafileSize sets the maximum datafile size option
|
||||
func WithMaxDatafileSize(size int) Option {
|
||||
return func(cfg *config.Config) error {
|
||||
|
||||
Reference in New Issue
Block a user