MCPcopy Create free account
hub / github.com/F-Stack/f-stack / sentinelSetClientName

Function sentinelSetClientName

app/redis-6.2.6/src/sentinel.c:2384–2395  ·  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

2382 * This makes it possible to list all the sentinel instances connected
2383 * to a Redis server with CLIENT LIST, grepping for a specific name format. */
2384void sentinelSetClientName(sentinelRedisInstance *ri, redisAsyncContext *c, char *type) {
2385 char name[64];
2386
2387 snprintf(name,sizeof(name),"sentinel-%.8s-%s",sentinel.myid,type);
2388 if (redisAsyncCommand(c, sentinelDiscardReplyCallback, ri,
2389 "%s SETNAME %s",
2390 sentinelInstanceMapCommand(ri,"CLIENT"),
2391 name) == C_OK)
2392 {
2393 ri->link->pending_commands++;
2394 }
2395}
2396
2397static int instanceLinkNegotiateTLS(redisAsyncContext *context) {
2398#ifndef USE_OPENSSL

Callers 1

Calls 3

snprintfFunction · 0.85
redisAsyncCommandFunction · 0.85

Tested by

no test coverage detected