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. */
| 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. */ |
| 8830 | int 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 |
nothing calls this directly
no test coverage detected