Unverified Commit f45e7901 authored by Salvatore Sanfilippo's avatar Salvatore Sanfilippo Committed by GitHub
Browse files

Merge pull request #4967 from JingchengLi/unstable

fix repeat argument issue and reduce unnessary loop times for redis-cli.
parents 0420c327 9505dd20
......@@ -1174,6 +1174,16 @@ static int cliSendCommand(int argc, char **argv, long repeat) {
} else if (!strcasecmp(command,"auth") && argc == 2) {
cliSelect();
}
/* Issue the command again if we got redirected in cluster mode */
if (config.cluster_mode && config.cluster_reissue_command) {
cliConnect(CC_FORCE);
config.cluster_reissue_command = 0;
/* for a '-MOVED' or '-ASK' response, we need to issue the command again, so
* add repeat by 1. */
repeat++;
}
}
if (config.interval) usleep(config.interval);
fflush(stdout); /* Make it grep friendly */
......@@ -1543,13 +1553,8 @@ static int issueCommandRepeat(int argc, char **argv, long repeat) {
cliPrintContextError();
return REDIS_ERR;
}
}
/* Issue the command again if we got redirected in cluster mode */
if (config.cluster_mode && config.cluster_reissue_command) {
cliConnect(CC_FORCE);
} else {
break;
}
} else
break;
}
return REDIS_OK;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment