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

Function RM_GetLRU

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

Gets the key last access time. * Value is idletime in milliseconds or -1 if the server's eviction policy is * LFU based. * returns REDISMODULE_OK if when key is valid. */

Source from the content-addressed store, hash-verified

8840 * LFU based.
8841 * returns REDISMODULE_OK if when key is valid. */
8842int RM_GetLRU(RedisModuleKey *key, mstime_t *lru_idle) {
8843 *lru_idle = -1;
8844 if (!key->value)
8845 return REDISMODULE_ERR;
8846 if (server.maxmemory_policy & MAXMEMORY_FLAG_LFU)
8847 return REDISMODULE_OK;
8848 *lru_idle = estimateObjectIdleTime(key->value);
8849 return REDISMODULE_OK;
8850}
8851
8852/* Set the key access frequency. only relevant if the server's maxmemory policy
8853 * is LFU based.

Callers

nothing calls this directly

Calls 1

estimateObjectIdleTimeFunction · 0.85

Tested by

no test coverage detected