Don't accept SAVE if BGSAVE is in progress

This commit is contained in:
antirez
2009-04-06 10:29:36 +02:00
parent ab48d029d9
commit 05557f6de7
2 changed files with 8 additions and 0 deletions

View File

@ -2310,6 +2310,10 @@ static void typeCommand(redisClient *c) {
}
static void saveCommand(redisClient *c) {
if (server.bgsaveinprogress) {
addReplySds(c,sdsnew("-ERR background save in progress\r\n"));
return;
}
if (rdbSave(server.dbfilename) == REDIS_OK) {
addReply(c,shared.ok);
} else {