From f737f27dd717e68e2b2bc967fb0dd734ff7828f5 Mon Sep 17 00:00:00 2001 From: Robey Pointer Date: Fri, 6 Aug 2010 16:04:27 -0700 Subject: [PATCH] weird. redis tries to save the db on exit, even if you asked it not to. patch to make it honor that. --- src/redis.c | 26 +++++++++++++++----------- 1 file 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...");