diff options
author | antirez <antirez@gmail.com> | 2011-11-18 14:10:48 +0100 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2011-11-18 14:10:48 +0100 |
commit | 4ab8695d537eff1dbc554bf3ab1896495311deda (patch) | |
tree | 35d0cf3e5bcc670492c0440261083492106d7b62 /src/db.c | |
parent | 5c85257b9615c050924f54b65b44ed54f49ac21d (diff) | |
download | redis-4ab8695d537eff1dbc554bf3ab1896495311deda.tar.gz |
New script timeout semantics and SCRIPT KILL implemented. SHUTDOWN NOSAVE and SHUTDOWN SAVE implemented.
Diffstat (limited to 'src/db.c')
-rw-r--r-- | src/db.c | 18 |
1 files changed, 16 insertions, 2 deletions
@@ -328,8 +328,22 @@ void typeCommand(redisClient *c) { } void shutdownCommand(redisClient *c) { - if (prepareForShutdown() == REDIS_OK) - exit(0); + int flags = 0; + + if (c->argc > 2) { + addReply(c,shared.syntaxerr); + return; + } else if (c->argc == 2) { + if (!strcasecmp(c->argv[1]->ptr,"nosave")) { + flags |= REDIS_SHUTDOWN_NOSAVE; + } else if (!strcasecmp(c->argv[1]->ptr,"save")) { + flags |= REDIS_SHUTDOWN_SAVE; + } else { + addReply(c,shared.syntaxerr); + return; + } + } + if (prepareForShutdown(flags) == REDIS_OK) exit(0); addReplyError(c,"Errors trying to SHUTDOWN. Check logs."); } |