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. */
| 8840 | * LFU based. |
| 8841 | * returns REDISMODULE_OK if when key is valid. */ |
| 8842 | int 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. |
nothing calls this directly
no test coverage detected