Return the expire time of the specified key, or -1 if no expire * is associated with this key (i.e. the key is non volatile) */
| 1426 | /* Return the expire time of the specified key, or -1 if no expire |
| 1427 | * is associated with this key (i.e. the key is non volatile) */ |
| 1428 | long long getExpire(redisDb *db, robj *key) { |
| 1429 | dictEntry *de; |
| 1430 | |
| 1431 | /* No expire? return ASAP */ |
| 1432 | if (dictSize(db->expires) == 0 || |
| 1433 | (de = dictFind(db->expires,key->ptr)) == NULL) return -1; |
| 1434 | |
| 1435 | /* The entry was found in the expire dict, this means it should also |
| 1436 | * be present in the main dict (safety check). */ |
| 1437 | serverAssertWithInfo(NULL,key,dictFind(db->dict,key->ptr) != NULL); |
| 1438 | return dictGetSignedIntegerVal(de); |
| 1439 | } |
| 1440 | |
| 1441 | /* Delete the specified expired key and propagate expire. */ |
| 1442 | void deleteExpiredKeyAndPropagate(redisDb *db, robj *keyobj) { |
no test coverage detected