]> git.saurik.com Git - redis.git/commitdiff
It is now posible to flush all the previous saving points in redis.conf by using...
authorantirez <antirez@gmail.com>
Mon, 16 Jan 2012 15:50:24 +0000 (16:50 +0100)
committerantirez <antirez@gmail.com>
Mon, 16 Jan 2012 15:50:24 +0000 (16:50 +0100)
redis.conf
src/config.c

index 29e326d121ffbf5275224c362099634221dd0a9c..1d2b5a5e29979c52c9db831536e48a92ad145d46 100644 (file)
@@ -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
index 4a25489a603f79933a54cc1f224aaeb90132c022..3f713e3e1ccb97d2b2057bf9b971e2533afb8116 100644 (file)
@@ -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",