mirror of
https://github.com/fluencelabs/redis
synced 2025-03-16 15:40:49 +00:00
Sentinel: reset pending_commands in a more generic way.
This commit is contained in:
parent
a23a5b6c7d
commit
9e5bef38e6
@ -765,7 +765,6 @@ void sentinelResetMaster(sentinelRedisInstance *ri, int flags) {
|
||||
ri->sentinels = dictCreate(&instancesDictType,NULL);
|
||||
if (ri->cc) sentinelKillLink(ri,ri->cc);
|
||||
if (ri->pc) sentinelKillLink(ri,ri->pc);
|
||||
ri->pending_commands = 0;
|
||||
ri->flags &= SRI_MASTER|SRI_CAN_FAILOVER|SRI_DISCONNECTED;
|
||||
if (ri->leader) {
|
||||
sdsfree(ri->leader);
|
||||
@ -891,7 +890,10 @@ char *sentinelHandleConfiguration(char **argv, int argc) {
|
||||
|
||||
/* Completely disconnect an hiredis link from an instance. */
|
||||
void sentinelKillLink(sentinelRedisInstance *ri, redisAsyncContext *c) {
|
||||
if (ri->cc == c) ri->cc = NULL;
|
||||
if (ri->cc == c) {
|
||||
ri->cc = NULL;
|
||||
ri->pending_commands = 0;
|
||||
}
|
||||
if (ri->pc == c) ri->pc = NULL;
|
||||
c->data = NULL;
|
||||
ri->flags |= SRI_DISCONNECTED;
|
||||
|
Loading…
x
Reference in New Issue
Block a user