Allow CONFIG GET during loading.
Thanks to @oranagra for the idea of allowing CONFIG GET during loading.
This commit is contained in:
parent
5500c51083
commit
995b9ffe07
@ -1923,6 +1923,12 @@ int rewriteConfig(char *path) {
|
|||||||
*----------------------------------------------------------------------------*/
|
*----------------------------------------------------------------------------*/
|
||||||
|
|
||||||
void configCommand(client *c) {
|
void configCommand(client *c) {
|
||||||
|
/* Only allow CONFIG GET while loading. */
|
||||||
|
if (server.loading && strcasecmp(c->argv[1]->ptr,"get")) {
|
||||||
|
addReplyError(c,"Only CONFIG GET is allowed during loading");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!strcasecmp(c->argv[1]->ptr,"set")) {
|
if (!strcasecmp(c->argv[1]->ptr,"set")) {
|
||||||
if (c->argc != 4) goto badarity;
|
if (c->argc != 4) goto badarity;
|
||||||
configSetCommand(c);
|
configSetCommand(c);
|
||||||
|
@ -254,7 +254,7 @@ struct redisCommand redisCommandTable[] = {
|
|||||||
{"slaveof",slaveofCommand,3,"ast",0,NULL,0,0,0,0,0},
|
{"slaveof",slaveofCommand,3,"ast",0,NULL,0,0,0,0,0},
|
||||||
{"role",roleCommand,1,"lst",0,NULL,0,0,0,0,0},
|
{"role",roleCommand,1,"lst",0,NULL,0,0,0,0,0},
|
||||||
{"debug",debugCommand,-1,"as",0,NULL,0,0,0,0,0},
|
{"debug",debugCommand,-1,"as",0,NULL,0,0,0,0,0},
|
||||||
{"config",configCommand,-2,"at",0,NULL,0,0,0,0,0},
|
{"config",configCommand,-2,"lat",0,NULL,0,0,0,0,0},
|
||||||
{"subscribe",subscribeCommand,-2,"pslt",0,NULL,0,0,0,0,0},
|
{"subscribe",subscribeCommand,-2,"pslt",0,NULL,0,0,0,0,0},
|
||||||
{"unsubscribe",unsubscribeCommand,-1,"pslt",0,NULL,0,0,0,0,0},
|
{"unsubscribe",unsubscribeCommand,-1,"pslt",0,NULL,0,0,0,0,0},
|
||||||
{"psubscribe",psubscribeCommand,-2,"pslt",0,NULL,0,0,0,0,0},
|
{"psubscribe",psubscribeCommand,-2,"pslt",0,NULL,0,0,0,0,0},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user