MCPcopy Create free account
hub / github.com/F-Stack/f-stack / getExpire

Function getExpire

app/redis-6.2.6/src/db.c:1428–1439  ·  view source on GitHub ↗

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) */

Source from the content-addressed store, hash-verified

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) */
1428long 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. */
1442void deleteExpiredKeyAndPropagate(redisDb *db, robj *keyobj) {

Callers 11

ttlGenericCommandFunction · 0.85
rdbSaveRioFunction · 0.85
renameGenericCommandFunction · 0.85
moveCommandFunction · 0.85
copyCommandFunction · 0.85
keyIsExpiredFunction · 0.85
migrateCommandFunction · 0.85
rewriteAppendOnlyFileRioFunction · 0.85
xorObjectDigestFunction · 0.85
RM_GetExpireFunction · 0.85
RM_GetAbsExpireFunction · 0.85

Calls 1

dictFindFunction · 0.70

Tested by

no test coverage detected