MCPcopy Create free account
hub / github.com/F-Stack/f-stack / shutdownCommand

Function shutdownCommand

app/redis-6.2.6/src/db.c:1070–1088  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1068}
1069
1070void shutdownCommand(client *c) {
1071 int flags = 0;
1072
1073 if (c->argc > 2) {
1074 addReplyErrorObject(c,shared.syntaxerr);
1075 return;
1076 } else if (c->argc == 2) {
1077 if (!strcasecmp(c->argv[1]->ptr,"nosave")) {
1078 flags |= SHUTDOWN_NOSAVE;
1079 } else if (!strcasecmp(c->argv[1]->ptr,"save")) {
1080 flags |= SHUTDOWN_SAVE;
1081 } else {
1082 addReplyErrorObject(c,shared.syntaxerr);
1083 return;
1084 }
1085 }
1086 if (prepareForShutdown(flags) == C_OK) exit(0);
1087 addReplyError(c,"Errors trying to SHUTDOWN. Check logs.");
1088}
1089
1090void renameGenericCommand(client *c, int nx) {
1091 robj *o;

Callers

nothing calls this directly

Calls 4

addReplyErrorObjectFunction · 0.85
strcasecmpFunction · 0.85
prepareForShutdownFunction · 0.85
addReplyErrorFunction · 0.85

Tested by

no test coverage detected