mirror of
https://github.com/fluencelabs/redis
synced 2025-06-12 16:51:22 +00:00
Obtain LRU clock in a resolution dependent way.
For testing purposes it is handy to have a very high resolution of the LRU clock, so that it is possible to experiment with scripts running in just a few seconds how the eviction algorithms works. This commit allows Redis to use the cached LRU clock, or a value computed on demand, depending on the resolution. So normally we have the good performance of a precomputed value, and a clock that wraps in many days using the normal resolution, but if needed, changing a define will switch behavior to an high resolution LRU clock.
This commit is contained in:
2
src/db.c
2
src/db.c
@ -50,7 +50,7 @@ robj *lookupKey(redisDb *db, robj *key) {
|
||||
* Don't do it if we have a saving child, as this will trigger
|
||||
* a copy on write madness. */
|
||||
if (server.rdb_child_pid == -1 && server.aof_child_pid == -1)
|
||||
val->lru = server.lruclock;
|
||||
val->lru = LRU_CLOCK();
|
||||
return val;
|
||||
} else {
|
||||
return NULL;
|
||||
|
Reference in New Issue
Block a user