mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-22 16:18:28 -05:00
re-fix config rewrite for empty save directive (#8722)
the bug was also discussed in #8716, and was solved in #8719, but incompletely: when the server is started, and the save option is default, if you issue the " config set save "" " to change the save option, and then issue the “config rewrite” command, the " save "" " won't be saved.
This commit is contained in:
parent
cd81dcf18b
commit
28375ff63e
@ -1385,7 +1385,7 @@ void rewriteConfigSaveOption(struct rewriteConfigState *state) {
|
||||
* defaults from being used.
|
||||
*/
|
||||
if (!server.saveparamslen) {
|
||||
rewriteConfigRewriteLine(state,"save",sdsnew("save \"\""),0);
|
||||
rewriteConfigRewriteLine(state,"save",sdsnew("save \"\""),1);
|
||||
} else {
|
||||
for (j = 0; j < server.saveparamslen; j++) {
|
||||
line = sdscatprintf(sdsempty(),"save %ld %d",
|
||||
|
@ -190,6 +190,14 @@ start_server {tags {"introspection"}} {
|
||||
r config rewrite
|
||||
restart_server 0 true false
|
||||
assert_equal [r config get save] {save {}}
|
||||
|
||||
start_server {config "minimal.conf"} {
|
||||
assert_equal [r config get save] {save {3600 1 300 100 60 10000}}
|
||||
r config set save ""
|
||||
r config rewrite
|
||||
restart_server 0 true false
|
||||
assert_equal [r config get save] {save {}}
|
||||
}
|
||||
}
|
||||
|
||||
# Config file at this point is at a wierd state, and includes all
|
||||
|
Loading…
Reference in New Issue
Block a user