Add comment explaining negative repeat

This commit is contained in:
Angus Pearson 2019-01-02 19:21:49 +00:00
parent 2f6ed9333f
commit 2925bdc63b

View File

@ -1141,6 +1141,8 @@ static int cliSendCommand(int argc, char **argv, long repeat) {
for (j = 0; j < argc; j++)
argvlen[j] = sdslen(argv[j]);
/* Negative repeat is allowed and causes infinite loop,
works well with the interval option. */
while(repeat < 0 || repeat-- > 0) {
redisAppendCommandArgv(context,argc,(const char**)argv,argvlen);
while (config.monitor_mode) {