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. */
| 9040 | * LFU based. |
| 9041 | * returns REDISMODULE_OK if when key is valid. */ |
| 9042 | int RM_GetLRU(RedisModuleKey *key, mstime_t *lru_idle) { |
| 9043 | *lru_idle = -1; |
| 9044 | if (!key->value) |
| 9045 | return REDISMODULE_ERR; |
| 9046 | if (g_pserver->maxmemory_policy & MAXMEMORY_FLAG_LFU) |
| 9047 | return REDISMODULE_OK; |
| 9048 | *lru_idle = estimateObjectIdleTime(key->value); |
| 9049 | return REDISMODULE_OK; |
| 9050 | } |
| 9051 | |
| 9052 | /* Set the key access frequency. only relevant if the server's maxmemory policy |
| 9053 | * is LFU based. |
nothing calls this directly
no test coverage detected