diff --git a/config/config.go b/config/config.go index d085b7bbd..f0b9b1a85 100644 --- a/config/config.go +++ b/config/config.go @@ -256,7 +256,7 @@ func MergeFlags(flags *Config) { DiceConfig.Logging.LogLevel = flags.Logging.LogLevel case "log-dir": DiceConfig.Logging.LogDir = flags.Logging.LogDir - case "persistence-enable": + case "enable-persistence": DiceConfig.Persistence.Enabled = flags.Persistence.Enabled case "restore-from-wal": DiceConfig.Persistence.RestoreFromWAL = flags.Persistence.RestoreFromWAL diff --git a/integration_tests/config/parser_test.go b/integration_tests/config/parser_test.go index 9102912cc..31a670288 100644 --- a/integration_tests/config/parser_test.go +++ b/integration_tests/config/parser_test.go @@ -73,7 +73,6 @@ type persistence struct { AOFFile string `config:"aof_file" default:"./dice-master.aof" validate:"filepath"` PersistenceEnabled bool `config:"persistence_enabled" default:"true"` WriteAOFOnCleanup bool `config:"write_aof_on_cleanup" default:"false"` - EnableWAL bool `config:"enable-wal" default:"false"` WALDir string `config:"wal-dir" default:"./" validate:"dirpath"` RestoreFromWAL bool `config:"restore-wal" default:"false"` WALEngine string `config:"wal-engine" default:"aof" validate:"oneof=sqlite aof"` diff --git a/internal/cli/cli.go b/internal/cli/cli.go index 7e7112a9f..36f80cf15 100644 --- a/internal/cli/cli.go +++ b/internal/cli/cli.go @@ -87,7 +87,7 @@ func Execute() { flag.StringVar(&flagsConfig.Logging.LogLevel, "log-level", "info", "log level, values: info, debug") flag.StringVar(&config.DiceConfig.Logging.LogDir, "log-dir", "/tmp/dicedb", "log directory path") - flag.BoolVar(&flagsConfig.Persistence.Enabled, "persistence-enable", false, "enable write-ahead logging") + flag.BoolVar(&flagsConfig.Persistence.Enabled, "enable-persistence", false, "enable write-ahead logging") flag.BoolVar(&flagsConfig.Persistence.RestoreFromWAL, "restore-wal", false, "restore the database from the WAL files") flag.StringVar(&flagsConfig.Persistence.WALEngine, "wal-engine", "null", "wal engine to use, values: sqlite, aof") @@ -124,7 +124,7 @@ func Execute() { fmt.Println(" -enable-profiling Enable profiling and capture critical metrics and traces in .prof files (default: false)") fmt.Println(" -log-level Log level, values: info, debug (default: \"info\")") fmt.Println(" -log-dir Log directory path (default: \"/tmp/dicedb\")") - fmt.Println(" -enable-wal Enable write-ahead logging (default: false)") + fmt.Println(" -enable-persistence Enable write-ahead logging (default: false)") fmt.Println(" -restore-wal Restore the database from the WAL files (default: false)") fmt.Println(" -wal-engine WAL engine to use, values: sqlite, aof (default: \"null\")") fmt.Println(" -requirepass Enable authentication for the default user (default: \"\")")