MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / RM_SetLRU

Function RM_SetLRU

src/module.cpp:9030–9036  ·  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

9028 * servers's maxmemory policy is LFU based. Value is idle time in milliseconds.
9029 * returns REDISMODULE_OK if the LRU was updated, REDISMODULE_ERR otherwise. */
9030int RM_SetLRU(RedisModuleKey *key, mstime_t lru_idle) {
9031 if (!key->value)
9032 return REDISMODULE_ERR;
9033 if (objectSetLRUOrLFU(key->value, -1, lru_idle, lru_idle>=0 ? LRU_CLOCK() : 0, 1))
9034 return REDISMODULE_OK;
9035 return REDISMODULE_ERR;
9036}
9037
9038/* Gets the key last access time.
9039 * 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