diff options
author | antirez <antirez@gmail.com> | 2015-05-04 12:01:39 +0200 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2015-05-04 12:05:56 +0200 |
commit | aaac257147acbb40e96c8d8be5c8d1aa249e5393 (patch) | |
tree | bb315e3dee2fec82dac1fd092094526ae4a90a6c | |
parent | cd05a665dc1dded3cfbc78ceaa5a5d00381f0ad7 (diff) | |
download | redis-less-mstime-28.tar.gz |
Use cached time in expireCommand()less-mstime-28
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
@@ -912,7 +912,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) { |