SENTINEL SET: error on bad option name + flush config on error.
This commit is contained in:
parent
f822516e43
commit
fe86f890b0
@ -2644,6 +2644,7 @@ void sentinelSetCommand(redisClient *c) {
|
|||||||
if (strlen(value) && access(value,X_OK) == -1) {
|
if (strlen(value) && access(value,X_OK) == -1) {
|
||||||
addReplyError(c,
|
addReplyError(c,
|
||||||
"Notification script seems non existing or non executable");
|
"Notification script seems non existing or non executable");
|
||||||
|
if (changes) sentinelFlushConfig();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
sdsfree(ri->notification_script);
|
sdsfree(ri->notification_script);
|
||||||
@ -2655,6 +2656,7 @@ void sentinelSetCommand(redisClient *c) {
|
|||||||
addReplyError(c,
|
addReplyError(c,
|
||||||
"Client reconfiguration script seems non existing or "
|
"Client reconfiguration script seems non existing or "
|
||||||
"non executable");
|
"non executable");
|
||||||
|
if (changes) sentinelFlushConfig();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
sdsfree(ri->client_reconfig_script);
|
sdsfree(ri->client_reconfig_script);
|
||||||
@ -2665,6 +2667,11 @@ void sentinelSetCommand(redisClient *c) {
|
|||||||
sdsfree(ri->auth_pass);
|
sdsfree(ri->auth_pass);
|
||||||
ri->auth_pass = strlen(value) ? sdsnew(value) : NULL;
|
ri->auth_pass = strlen(value) ? sdsnew(value) : NULL;
|
||||||
changes++;
|
changes++;
|
||||||
|
} else {
|
||||||
|
addReplyErrorFormat(c,"Unknown option '%s' for SENTINEL SET",
|
||||||
|
option);
|
||||||
|
if (changes) sentinelFlushConfig();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user