summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobey Pointer <robey@twitter.com>2010-08-06 16:04:27 -0700
committerRobey Pointer <robey@twitter.com>2010-08-19 13:37:45 -0700
commitf737f27dd717e68e2b2bc967fb0dd734ff7828f5 (patch)
tree77f39e1804bd063c514b517dcf8294acb77bbbf5
parentcbce5171451eb53f1370aacc30decd74512347ac (diff)
downloadredis-f737f27dd717e68e2b2bc967fb0dd734ff7828f5.tar.gz
weird. redis tries to save the db on exit, even if you asked it not to. patch to make it honor that.
-rw-r--r--src/redis.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/src/redis.c b/src/redis.c
index 1a581a92a..ad0fa706c 100644
--- a/src/redis.c
+++ b/src/redis.c
@@ -1076,18 +1076,22 @@ int prepareForShutdown() {
if (server.vm_enabled) unlink(server.vm_swap_file);
} else {
/* Snapshotting. Perform a SYNC SAVE and exit */
- if (rdbSave(server.dbfilename) == REDIS_OK) {
- if (server.daemonize)
- unlink(server.pidfile);
- redisLog(REDIS_WARNING,"%zu bytes used at exit",zmalloc_used_memory());
+ if (server.saveparamslen == 0) {
+ redisLog(REDIS_WARNING,"Not saving DB.");
} else {
- /* Ooops.. error saving! The best we can do is to continue
- * operating. Note that if there was a background saving process,
- * in the next cron() Redis will be notified that the background
- * saving aborted, handling special stuff like slaves pending for
- * synchronization... */
- redisLog(REDIS_WARNING,"Error trying to save the DB, can't exit");
- return REDIS_ERR;
+ if (rdbSave(server.dbfilename) == REDIS_OK) {
+ if (server.daemonize)
+ unlink(server.pidfile);
+ redisLog(REDIS_WARNING,"%zu bytes used at exit",zmalloc_used_memory());
+ } else {
+ /* Ooops.. error saving! The best we can do is to continue
+ * operating. Note that if there was a background saving process,
+ * in the next cron() Redis will be notified that the background
+ * saving aborted, handling special stuff like slaves pending for
+ * synchronization... */
+ redisLog(REDIS_WARNING,"Error trying to save the DB, can't exit");
+ return REDIS_ERR;
+ }
}
}
redisLog(REDIS_WARNING,"Server exit now, bye bye...");