Commit 4aac3ff2 authored by antirez's avatar antirez
Browse files

It is now posible to flush all the previous saving points in redis.conf by...

It is now posible to flush all the previous saving points in redis.conf by using a save directive with a single empty string argument, like it happens for CONFIG SET save.
parent ebdfad69
...@@ -82,6 +82,12 @@ databases 16 ...@@ -82,6 +82,12 @@ databases 16
# after 60 sec if at least 10000 keys changed # after 60 sec if at least 10000 keys changed
# #
# Note: you can disable saving at all commenting all the "save" lines. # Note: you can disable saving at all commenting all the "save" lines.
#
# It is also possible to remove all the previously configured save
# points by adding a save directive with a single empty string argument
# like in the following example:
#
# save ""
save 900 1 save 900 1
save 300 10 save 300 10
......
...@@ -65,13 +65,17 @@ void loadServerConfigFromString(char *config) { ...@@ -65,13 +65,17 @@ void loadServerConfigFromString(char *config) {
if (errno || server.unixsocketperm > 0777) { if (errno || server.unixsocketperm > 0777) {
err = "Invalid socket file permissions"; goto loaderr; err = "Invalid socket file permissions"; goto loaderr;
} }
} else if (!strcasecmp(argv[0],"save") && argc == 3) { } else if (!strcasecmp(argv[0],"save")) {
int seconds = atoi(argv[1]); if (argc == 3) {
int changes = atoi(argv[2]); int seconds = atoi(argv[1]);
if (seconds < 1 || changes < 0) { int changes = atoi(argv[2]);
err = "Invalid save parameters"; goto loaderr; if (seconds < 1 || changes < 0) {
err = "Invalid save parameters"; goto loaderr;
}
appendServerSaveParams(seconds,changes);
} else if (argc == 2 && !strcasecmp(argv[1],"")) {
resetServerSaveParams();
} }
appendServerSaveParams(seconds,changes);
} else if (!strcasecmp(argv[0],"dir") && argc == 2) { } else if (!strcasecmp(argv[0],"dir") && argc == 2) {
if (chdir(argv[1]) == -1) { if (chdir(argv[1]) == -1) {
redisLog(REDIS_WARNING,"Can't chdir to '%s': %s", redisLog(REDIS_WARNING,"Can't chdir to '%s': %s",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment