mirror of
https://github.com/fluencelabs/redis
synced 2025-03-24 03:20:49 +00:00
Don't put clients into unblocked list multiple times
This commit is contained in:
parent
9f9c44feef
commit
f7bd816bbb
@ -137,10 +137,14 @@ void unblockClient(redisClient *c) {
|
||||
/* Clear the flags, and put the client in the unblocked list so that
|
||||
* we'll process new commands in its query buffer ASAP. */
|
||||
c->flags &= ~REDIS_BLOCKED;
|
||||
c->flags |= REDIS_UNBLOCKED;
|
||||
c->btype = REDIS_BLOCKED_NONE;
|
||||
server.bpop_blocked_clients--;
|
||||
listAddNodeTail(server.unblocked_clients,c);
|
||||
/* The client may already be into the unblocked list because of a previous
|
||||
* blocking operation, don't add back it into the list multiple times. */
|
||||
if (!(c->flags & REDIS_UNBLOCKED)) {
|
||||
c->flags |= REDIS_UNBLOCKED;
|
||||
listAddNodeTail(server.unblocked_clients,c);
|
||||
}
|
||||
}
|
||||
|
||||
/* This function gets called when a blocked client timed out in order to
|
||||
|
Loading…
x
Reference in New Issue
Block a user