diff options
author | antirez <antirez@gmail.com> | 2015-05-04 12:01:39 +0200 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2015-05-04 12:03:25 +0200 |
commit | d57ac2c872a70f766f399e56481497d7c3747263 (patch) | |
tree | 27b226e1bd573496ee96d916f548ce531200b380 | |
parent | 27db456332fa2390d83ca8f4617a49035d0484e6 (diff) | |
download | redis-less-mstime.tar.gz |
Use cached time in expireCommand()less-mstime
Should not be an issue given that the precision is the second here, at
least if we are using a decent HZ value and the cached time refreshes
enough times. So the cached time is only used if HZ is >= 10.
-rw-r--r-- | src/db.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -956,7 +956,8 @@ void expireGenericCommand(redisClient *c, long long basetime, int unit) { } void expireCommand(redisClient *c) { - expireGenericCommand(c,mstime(),UNIT_SECONDS); + long long now = server.hz >= 10 ? server.mstime: mstime(); + expireGenericCommand(c,now,UNIT_SECONDS); } void expireatCommand(redisClient *c) { |