Add prompt when Ctrl-C pressed (#702)
When I play the pubsub command in console, I am confused by the following scenario:  The reason is that when I press Ctrl-C, client exits current connection and reconnects to the server. Thus I add one prompt message to make everyone clear what it happens.  --------- Signed-off-by: hwware <wen.hui.ware@gmail.com>
This commit is contained in:
parent
b59762f734
commit
7415a576a8
@ -2273,6 +2273,8 @@ static void cliWaitForMessagesOrStdin(void) {
|
|||||||
/* Ctrl-C pressed */
|
/* Ctrl-C pressed */
|
||||||
config.blocking_state_aborted = 0;
|
config.blocking_state_aborted = 0;
|
||||||
config.pubsub_mode = 0;
|
config.pubsub_mode = 0;
|
||||||
|
printf("Closing current connection. Ready to reconnect to Valkey server... \n");
|
||||||
|
fflush(stdout);
|
||||||
if (cliConnect(CC_FORCE) != REDIS_OK) {
|
if (cliConnect(CC_FORCE) != REDIS_OK) {
|
||||||
cliPrintContextError();
|
cliPrintContextError();
|
||||||
exit(1);
|
exit(1);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user