Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
9505dd20
Commit
9505dd20
authored
Jul 10, 2018
by
tengfeng
Browse files
fix repeat argument issue and reduce unnessary loop times for redis-cli.
parent
0420c327
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/redis-cli.c
View file @
9505dd20
...
@@ -1174,6 +1174,16 @@ static int cliSendCommand(int argc, char **argv, long repeat) {
...
@@ -1174,6 +1174,16 @@ static int cliSendCommand(int argc, char **argv, long repeat) {
}
else
if
(
!
strcasecmp
(
command
,
"auth"
)
&&
argc
==
2
)
{
}
else
if
(
!
strcasecmp
(
command
,
"auth"
)
&&
argc
==
2
)
{
cliSelect
();
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
);
if
(
config
.
interval
)
usleep
(
config
.
interval
);
fflush
(
stdout
);
/* Make it grep friendly */
fflush
(
stdout
);
/* Make it grep friendly */
...
@@ -1543,13 +1553,8 @@ static int issueCommandRepeat(int argc, char **argv, long repeat) {
...
@@ -1543,13 +1553,8 @@ static int issueCommandRepeat(int argc, char **argv, long repeat) {
cliPrintContextError
();
cliPrintContextError
();
return
REDIS_ERR
;
return
REDIS_ERR
;
}
}
}
}
else
/* Issue the command again if we got redirected in cluster mode */
break
;
if
(
config
.
cluster_mode
&&
config
.
cluster_reissue_command
)
{
cliConnect
(
CC_FORCE
);
}
else
{
break
;
}
}
}
return
REDIS_OK
;
return
REDIS_OK
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment