mirror of
https://github.com/fluencelabs/redis
synced 2025-04-20 08:02:13 +00:00
In scanDatabaseForReadyLists() now we need to handle ZSETs as well.
Since the introduction of ZPOP makes this needed. Thanks to @oranagra for reporting.
This commit is contained in:
parent
f70e88c1f6
commit
e534e9aa83
10
src/db.c
10
src/db.c
@ -942,16 +942,18 @@ void moveCommand(client *c) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Helper function for dbSwapDatabases(): scans the list of keys that have
|
/* Helper function for dbSwapDatabases(): scans the list of keys that have
|
||||||
* one or more blocked clients for B[LR]POP or other list blocking commands
|
* one or more blocked clients for B[LR]POP or other blocking commands
|
||||||
* and signal the keys are ready if they are lists. See the comment where
|
* and signal the keys as ready if they are of the right type. See the comment
|
||||||
* the function is used for more info. */
|
* where the function is used for more info. */
|
||||||
void scanDatabaseForReadyLists(redisDb *db) {
|
void scanDatabaseForReadyLists(redisDb *db) {
|
||||||
dictEntry *de;
|
dictEntry *de;
|
||||||
dictIterator *di = dictGetSafeIterator(db->blocking_keys);
|
dictIterator *di = dictGetSafeIterator(db->blocking_keys);
|
||||||
while((de = dictNext(di)) != NULL) {
|
while((de = dictNext(di)) != NULL) {
|
||||||
robj *key = dictGetKey(de);
|
robj *key = dictGetKey(de);
|
||||||
robj *value = lookupKey(db,key,LOOKUP_NOTOUCH);
|
robj *value = lookupKey(db,key,LOOKUP_NOTOUCH);
|
||||||
if (value && (value->type == OBJ_LIST || value->type == OBJ_STREAM))
|
if (value && (value->type == OBJ_LIST ||
|
||||||
|
value->type == OBJ_STREAM ||
|
||||||
|
value->type == OBJ_ZSET))
|
||||||
signalKeyAsReady(db, key);
|
signalKeyAsReady(db, key);
|
||||||
}
|
}
|
||||||
dictReleaseIterator(di);
|
dictReleaseIterator(di);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user