Sentinel: added SENTINEL MASTER <name> command.
With SENTINEL MASTERS it was already possible to list all the configured masters, but not a specific one.
This commit is contained in:
parent
2bb9cd464e
commit
c42e4bd0b6
@ -2378,8 +2378,14 @@ void sentinelCommand(redisClient *c) {
|
||||
if (!strcasecmp(c->argv[1]->ptr,"masters")) {
|
||||
/* SENTINEL MASTERS */
|
||||
if (c->argc != 2) goto numargserr;
|
||||
|
||||
addReplyDictOfRedisInstances(c,sentinel.masters);
|
||||
} else if (!strcasecmp(c->argv[1]->ptr,"master")) {
|
||||
/* SENTINEL MASTER <name> */
|
||||
sentinelRedisInstance *ri;
|
||||
|
||||
if ((ri = sentinelGetMasterByNameOrReplyError(c,c->argv[2]))
|
||||
== NULL) return;
|
||||
addReplySentinelRedisInstance(c,ri);
|
||||
} else if (!strcasecmp(c->argv[1]->ptr,"slaves")) {
|
||||
/* SENTINEL SLAVES <master-name> */
|
||||
sentinelRedisInstance *ri;
|
||||
|
Loading…
x
Reference in New Issue
Block a user