MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / sentinelSetClientName

Function sentinelSetClientName

src/sentinel.cpp:2396–2407  ·  view source on GitHub ↗

Use CLIENT SETNAME to name the connection in the Redis instance as * sentinel- - * The connection type is "cmd" or "pubsub" as specified by 'type'. * * This makes it possible to list all the sentinel instances connected * to a Redis server with CLIENT LIST, grepping for a specific name format. */

Source from the content-addressed store, hash-verified

2394 * This makes it possible to list all the sentinel instances connected
2395 * to a Redis server with CLIENT LIST, grepping for a specific name format. */
2396void sentinelSetClientName(sentinelRedisInstance *ri, redisAsyncContext *c, const char *type) {
2397 char name[64];
2398
2399 snprintf(name,sizeof(name),"sentinel-%.8s-%s",sentinel.myid,type);
2400 if (redisAsyncCommand(c, sentinelDiscardReplyCallback, ri,
2401 "%s SETNAME %s",
2402 sentinelInstanceMapCommand(ri,"CLIENT"),
2403 name) == C_OK)
2404 {
2405 ri->link->pending_commands++;
2406 }
2407}
2408
2409static int instanceLinkNegotiateTLS(redisAsyncContext *context) {
2410#ifndef USE_OPENSSL

Callers 1

Calls 2

redisAsyncCommandFunction · 0.85

Tested by

no test coverage detected