source reshaped a bit to play well with a bgsaving thread, still work to do, does not compile.

This commit is contained in:
antirez
2011-01-07 18:15:14 +01:00
parent cb9b35c8ca
commit 36c17a53b6
8 changed files with 103 additions and 54 deletions

View File

@ -379,30 +379,6 @@ void typeCommand(redisClient *c) {
addReplyStatus(c,type);
}
void saveCommand(redisClient *c) {
if (server.bgsavechildpid != -1) {
addReplyError(c,"Background save already in progress");
return;
}
if (rdbSave(server.dbfilename) == REDIS_OK) {
addReply(c,shared.ok);
} else {
addReply(c,shared.err);
}
}
void bgsaveCommand(redisClient *c) {
if (server.bgsavechildpid != -1) {
addReplyError(c,"Background save already in progress");
return;
}
if (rdbSaveBackground(server.dbfilename) == REDIS_OK) {
addReplyStatus(c,"Background saving started");
} else {
addReply(c,shared.err);
}
}
void shutdownCommand(redisClient *c) {
if (prepareForShutdown() == REDIS_OK)
exit(0);