if server.saveparamslen is not set, don't save the DB on exit.

This commit is contained in:
Robey Pointer 2010-09-30 11:53:34 -07:00 committed by antirez
parent fc41345116
commit d8a717fb1a

View File

@ -1093,7 +1093,7 @@ int prepareForShutdown() {
/* Append only file: fsync() the AOF and exit */
aof_fsync(server.appendfd);
if (server.vm_enabled) unlink(server.vm_swap_file);
} else {
} else if (server.saveparamslen > 0) {
/* Snapshotting. Perform a SYNC SAVE and exit */
if (rdbSave(server.dbfilename) != REDIS_OK) {
/* Ooops.. error saving! The best we can do is to continue
@ -1104,6 +1104,8 @@ int prepareForShutdown() {
redisLog(REDIS_WARNING,"Error trying to save the DB, can't exit");
return REDIS_ERR;
}
} else {
redisLog(REDIS_WARNING,"Not saving DB.");
}
if (server.daemonize) unlink(server.pidfile);
redisLog(REDIS_WARNING,"Server exit now, bye bye...");