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

Function RM_GetExpire

app/redis-6.2.6/src/module.c:2361–2367  ·  view source on GitHub ↗

Return the key expire value, as milliseconds of remaining TTL. * If no TTL is associated with the key or if the key is empty, * REDISMODULE_NO_EXPIRE is returned. */

Source from the content-addressed store, hash-verified

2359 * If no TTL is associated with the key or if the key is empty,
2360 * REDISMODULE_NO_EXPIRE is returned. */
2361mstime_t RM_GetExpire(RedisModuleKey *key) {
2362 mstime_t expire = getExpire(key->db,key->key);
2363 if (expire == -1 || key->value == NULL)
2364 return REDISMODULE_NO_EXPIRE;
2365 expire -= mstime();
2366 return expire >= 0 ? expire : 0;
2367}
2368
2369/* Set a new expire for the key. If the special expire
2370 * REDISMODULE_NO_EXPIRE is set, the expire is cancelled if there was

Callers

nothing calls this directly

Calls 2

getExpireFunction · 0.85
mstimeFunction · 0.70

Tested by

no test coverage detected