summaryrefslogtreecommitdiff
path: root/src/redis-cli.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/redis-cli.c')
-rw-r--r--src/redis-cli.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/redis-cli.c b/src/redis-cli.c
index ef1d49e3e..63d31f79a 100644
--- a/src/redis-cli.c
+++ b/src/redis-cli.c
@@ -819,6 +819,9 @@ static int cliConnect(int flags) {
if (context == NULL || flags & CC_FORCE) {
if (context != NULL) {
redisFree(context);
+ config.dbnum = 0;
+ config.in_multi = 0;
+ cliRefreshPrompt();
}
if (config.hostsocket == NULL) {
@@ -2969,7 +2972,7 @@ static void clusterManagerOptimizeAntiAffinity(clusterManagerNodeArray *ipnodes,
ip_count,
&offenders,
&offending_len);
- if (score == 0) break; // Optimal anti affinity reached
+ if (score == 0 || offending_len == 0) break; // Optimal anti affinity reached
/* We'll try to randomly swap a slave's assigned master causing
* an affinity problem with another random slave, to see if we
* can improve the affinity. */