diff options
author | Hyungjin Kim <kim@hyjin.com> | 2017-01-30 20:00:04 +0900 |
---|---|---|
committer | Hyungjin Kim <kim@hyjin.com> | 2017-01-30 20:00:04 +0900 |
commit | be76c56b519a0390a7d7b0535685cdaa8254388e (patch) | |
tree | c5e879b4bb82cda5d7d3d5e46be70c0d07a0cb00 | |
parent | 073dc84399d29a2648aa20ad687524795d13609e (diff) |
Consider sub by pattern when clear subscribed flag
-rw-r--r-- | async.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -407,7 +407,9 @@ static int __redisGetSubscribeCallback(redisAsyncContext *ac, redisReply *reply, assert(reply->element[2]->type == REDIS_REPLY_INTEGER); /* Unset subscribed flag only when no pipelined pending subscribe. */ - if (reply->element[2]->integer == 0 && dictSize(callbacks) == 0) + if (reply->element[2]->integer == 0 + && dictSize(ac->sub.channels) == 0 + && dictSize(ac->sub.patterns) == 0) c->flags &= ~REDIS_SUBSCRIBED; } } |