]> git.saurik.com Git - redis.git/commitdiff
added cache-flush-delay configuration directive. Don't BGSAVE when using diskstore
authorantirez <antirez@gmail.com>
Thu, 30 Dec 2010 16:53:28 +0000 (17:53 +0100)
committerantirez <antirez@gmail.com>
Thu, 30 Dec 2010 16:53:28 +0000 (17:53 +0100)
src/config.c
src/redis.c

index a4060631c3b95aab658fcab25686350343140140..3ba87c738c6b781f638453fd741723bfb70bb79d 100644 (file)
@@ -250,6 +250,9 @@ void loadServerConfig(char *filename) {
             server.ds_path = sdsnew(argv[1]);
         } else if (!strcasecmp(argv[0],"cache-max-memory") && argc == 2) {
             server.cache_max_memory = memtoll(argv[1],NULL);
+        } else if (!strcasecmp(argv[0],"cache-flush-delay") && argc == 2) {
+            server.cache_flush_delay = atoi(argv[1]);
+            if (server.cache_flush_delay < 0) server.cache_flush_delay = 0;
         } else if (!strcasecmp(argv[0],"hash-max-zipmap-entries") && argc == 2) {
             server.hash_max_zipmap_entries = memtoll(argv[1], NULL);
         } else if (!strcasecmp(argv[0],"hash-max-zipmap-value") && argc == 2) {
index 13fe0f3c6d6a71828993d4c1dbf11888b51c98a4..bb917f50f0c7db3ca346dd12dfa971638bf8c704 100644 (file)
@@ -596,7 +596,7 @@ int serverCron(struct aeEventLoop *eventLoop, long long id, void *clientData) {
             }
             updateDictResizePolicy();
         }
-    } else {
+    } else if (!server.ds_enabled) {
         /* If there is not a background saving in progress check if
          * we have to save now */
          time_t now = time(NULL);