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

Function RM_SetLRU

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

Set the key last access time for LRU based eviction. not relevant if the * servers's maxmemory policy is LFU based. Value is idle time in milliseconds. * returns REDISMODULE_OK if the LRU was updated, REDISMODULE_ERR otherwise. */

Source from the content-addressed store, hash-verified

8828 * servers's maxmemory policy is LFU based. Value is idle time in milliseconds.
8829 * returns REDISMODULE_OK if the LRU was updated, REDISMODULE_ERR otherwise. */
8830int RM_SetLRU(RedisModuleKey *key, mstime_t lru_idle) {
8831 if (!key->value)
8832 return REDISMODULE_ERR;
8833 if (objectSetLRUOrLFU(key->value, -1, lru_idle, lru_idle>=0 ? LRU_CLOCK() : 0, 1))
8834 return REDISMODULE_OK;
8835 return REDISMODULE_ERR;
8836}
8837
8838/* Gets the key last access time.
8839 * Value is idletime in milliseconds or -1 if the server's eviction policy is

Callers

nothing calls this directly

Calls 2

objectSetLRUOrLFUFunction · 0.85
LRU_CLOCKFunction · 0.85

Tested by

no test coverage detected