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

Function clusterManagerGetNodeRedisInfo

src/redis-cli.c:2633–2648  ·  view source on GitHub ↗

Call "INFO" redis command on the specified node and return the reply. */

Source from the content-addressed store, hash-verified

2631
2632/* Call "INFO" redis command on the specified node and return the reply. */
2633static redisReply *clusterManagerGetNodeRedisInfo(clusterManagerNode *node,
2634 char **err)
2635{
2636 redisReply *info = CLUSTER_MANAGER_COMMAND(node, "INFO");
2637 if (err != NULL) *err = NULL;
2638 if (info == NULL) return NULL;
2639 if (info->type == REDIS_REPLY_ERROR) {
2640 if (err != NULL) {
2641 *err = zmalloc((info->len + 1) * sizeof(char), MALLOC_LOCAL);
2642 strcpy(*err, info->str);
2643 }
2644 freeReplyObject(info);
2645 return NULL;
2646 }
2647 return info;
2648}
2649
2650static int clusterManagerNodeIsCluster(clusterManagerNode *node, char **err) {
2651 redisReply *info = clusterManagerGetNodeRedisInfo(node, err);

Callers 2

Calls 2

zmallocFunction · 0.85
freeReplyObjectFunction · 0.85

Tested by

no test coverage detected