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

Function cliSendAsking

app/redis-6.2.6/src/redis-cli.c:930–949  ·  view source on GitHub ↗

In cluster, if server replies ASK, we will redirect to a different node. * Before sending the real command, we need to send ASKING command first. */

Source from the content-addressed store, hash-verified

928/* In cluster, if server replies ASK, we will redirect to a different node.
929 * Before sending the real command, we need to send ASKING command first. */
930static int cliSendAsking() {
931 redisReply *reply;
932
933 config.cluster_send_asking = 0;
934 if (context == NULL) {
935 return REDIS_ERR;
936 }
937 reply = redisCommand(context,"ASKING");
938 if (reply == NULL) {
939 fprintf(stderr, "\nI/O error\n");
940 return REDIS_ERR;
941 }
942 int result = REDIS_OK;
943 if (reply->type == REDIS_REPLY_ERROR) {
944 result = REDIS_ERR;
945 fprintf(stderr,"ASKING failed: %s\n",reply->str);
946 }
947 freeReplyObject(reply);
948 return result;
949}
950
951static void cliPrintContextError(void) {
952 if (context == NULL) return;

Callers 1

issueCommandRepeatFunction · 0.85

Calls 2

freeReplyObjectFunction · 0.85
redisCommandClass · 0.70

Tested by

no test coverage detected