Skip to content

Commit

Permalink
Update rewriteConfigSaveOption function code to rewrite config approp…
Browse files Browse the repository at this point in the history
…riately

Signed-off-by: Shivshankar-Reddy <[email protected]>
  • Loading branch information
Shivshankar-Reddy committed May 31, 2024
1 parent f927565 commit 12b934d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -1369,11 +1369,12 @@ void rewriteConfigSaveOption(standardConfig *config, const char *name, struct re
if (!server.saveparamslen) {
rewriteConfigRewriteLine(state, name, sdsnew("save \"\""), 1);
} else {
line = sdsnew(name);
for (j = 0; j < server.saveparamslen; j++) {
line = sdscatprintf(sdsempty(), "save %ld %d", (long)server.saveparams[j].seconds,
line = sdscatprintf(line, " %ld %d", (long)server.saveparams[j].seconds,
server.saveparams[j].changes);
rewriteConfigRewriteLine(state, name, line, 1);
}
rewriteConfigRewriteLine(state, name, line, 1);
}

/* Mark "save" as processed in case server.saveparamslen is zero. */
Expand Down

0 comments on commit 12b934d

Please sign in to comment.