Helper function for dbSwapDatabases(): scans the list of keys that have * one or more blocked clients for B[LR]POP or other blocking commands * and signal the keys as ready if they are of the right type. See the comment * where the function is used for more info. */
| 1306 | * and signal the keys as ready if they are of the right type. See the comment |
| 1307 | * where the function is used for more info. */ |
| 1308 | void scanDatabaseForReadyLists(redisDb *db) { |
| 1309 | dictEntry *de; |
| 1310 | dictIterator *di = dictGetSafeIterator(db->blocking_keys); |
| 1311 | while((de = dictNext(di)) != NULL) { |
| 1312 | robj *key = dictGetKey(de); |
| 1313 | robj *value = lookupKey(db,key,LOOKUP_NOTOUCH); |
| 1314 | if (value) signalKeyAsReady(db, key, value->type); |
| 1315 | } |
| 1316 | dictReleaseIterator(di); |
| 1317 | } |
| 1318 | |
| 1319 | /* Swap two databases at runtime so that all clients will magically see |
| 1320 | * the new database even if already connected. Note that the client |
no test coverage detected