mirror of
https://github.com/fluencelabs/redis
synced 2025-04-01 15:21:03 +00:00
redis-cli in REPL mode is now able to send the same command multiple times, prefixing the command with a number as in "10 ping"
This commit is contained in:
parent
a45f9a1a1d
commit
4d19e3443c
@ -680,12 +680,22 @@ static void repl() {
|
|||||||
linenoiseClearScreen();
|
linenoiseClearScreen();
|
||||||
} else {
|
} else {
|
||||||
long long start_time = mstime(), elapsed;
|
long long start_time = mstime(), elapsed;
|
||||||
|
int repeat, skipargs = 0;
|
||||||
|
|
||||||
if (cliSendCommand(argc,argv,1) != REDIS_OK) {
|
repeat = atoi(argv[0]);
|
||||||
|
if (repeat) {
|
||||||
|
skipargs = 1;
|
||||||
|
} else {
|
||||||
|
repeat = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cliSendCommand(argc-skipargs,argv+skipargs,repeat)
|
||||||
|
!= REDIS_OK)
|
||||||
|
{
|
||||||
cliConnect(1);
|
cliConnect(1);
|
||||||
|
|
||||||
/* If we still cannot send the command,
|
/* If we still cannot send the command print error.
|
||||||
* print error and abort. */
|
* We'll try to reconnect the next time. */
|
||||||
if (cliSendCommand(argc,argv,1) != REDIS_OK)
|
if (cliSendCommand(argc,argv,1) != REDIS_OK)
|
||||||
cliPrintContextError();
|
cliPrintContextError();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user