Skip to content
Browse files

It is now posible to flush all the previous saving points in redis.co…

…nf by using a save directive with a single empty string argument, like it happens for CONFIG SET save.
  • Loading branch information...
1 parent ebdfad6 commit 4aac3ff2473b4e70dd503ff5c65891146dac30fc @antirez committed Jan 16, 2012
Showing with 16 additions and 6 deletions.
  1. +6 −0 redis.conf
  2. +10 −6 src/config.c
View
6 redis.conf
@@ -82,6 +82,12 @@ databases 16
# after 60 sec if at least 10000 keys changed
#
# 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 300 10
View
16 src/config.c
@@ -65,13 +65,17 @@ void loadServerConfigFromString(char *config) {
if (errno || server.unixsocketperm > 0777) {
err = "Invalid socket file permissions"; goto loaderr;
}
- } else if (!strcasecmp(argv[0],"save") && argc == 3) {
- int seconds = atoi(argv[1]);
- int changes = atoi(argv[2]);
- if (seconds < 1 || changes < 0) {
- err = "Invalid save parameters"; goto loaderr;
+ } else if (!strcasecmp(argv[0],"save")) {
+ if (argc == 3) {
+ int seconds = atoi(argv[1]);
+ int changes = atoi(argv[2]);
+ 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) {
if (chdir(argv[1]) == -1) {
redisLog(REDIS_WARNING,"Can't chdir to '%s': %s",

0 comments on commit 4aac3ff

Please sign in to comment.
Something went wrong with that request. Please try again.