mirror of
https://github.com/fluencelabs/redis
synced 2025-03-31 14:51:04 +00:00
Sentinel: add sentinelGetInstanceTypeString() fuction
This is useful for debugging and logging activities: given a sentinelRedisInstance object returns a C string representing the instance type: master, slave, sentinel.
This commit is contained in:
parent
d6e1347869
commit
e0a5246f06
@ -1458,6 +1458,13 @@ void sentinelPropagateDownAfterPeriod(sentinelRedisInstance *master) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
char *sentinelGetInstanceTypeString(sentinelRedisInstance *ri) {
|
||||||
|
if (ri->flags & SRI_MASTER) return "master";
|
||||||
|
else if (ri->flags & SRI_SLAVE) return "slave";
|
||||||
|
else if (ri->flags & SRI_SENTINEL) return "sentinel";
|
||||||
|
else return "unknown";
|
||||||
|
}
|
||||||
|
|
||||||
/* ============================ Config handling ============================= */
|
/* ============================ Config handling ============================= */
|
||||||
char *sentinelHandleConfiguration(char **argv, int argc) {
|
char *sentinelHandleConfiguration(char **argv, int argc) {
|
||||||
sentinelRedisInstance *ri;
|
sentinelRedisInstance *ri;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user