Skip to content

Commit 9f43264

Browse files
committed
Revert "fix repeat argument issue and reduce unnessary loop times for redis-cli."
Reverts commit 9505dd2 since the commit introduced the very serious bug issue redis#5286.
1 parent 394b974 commit 9f43264

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

src/redis-cli.c

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1173,16 +1173,6 @@ static int cliSendCommand(int argc, char **argv, long repeat) {
11731173
} else if (!strcasecmp(command,"auth") && argc == 2) {
11741174
cliSelect();
11751175
}
1176-
1177-
1178-
/* Issue the command again if we got redirected in cluster mode */
1179-
if (config.cluster_mode && config.cluster_reissue_command) {
1180-
cliConnect(CC_FORCE);
1181-
config.cluster_reissue_command = 0;
1182-
/* for a '-MOVED' or '-ASK' response, we need to issue the command again, so
1183-
* add repeat by 1. */
1184-
repeat++;
1185-
}
11861176
}
11871177
if (config.interval) usleep(config.interval);
11881178
fflush(stdout); /* Make it grep friendly */
@@ -1563,8 +1553,13 @@ static int issueCommandRepeat(int argc, char **argv, long repeat) {
15631553
cliPrintContextError();
15641554
return REDIS_ERR;
15651555
}
1566-
} else
1567-
break;
1556+
}
1557+
/* Issue the command again if we got redirected in cluster mode */
1558+
if (config.cluster_mode && config.cluster_reissue_command) {
1559+
cliConnect(CC_FORCE);
1560+
} else {
1561+
break;
1562+
}
15681563
}
15691564
return REDIS_OK;
15701565
}

0 commit comments

Comments
 (0)