Commit aaac2571 authored by antirez's avatar antirez
Browse files

Use cached time in expireCommand()

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.
parent cd05a665
...@@ -912,7 +912,8 @@ void expireGenericCommand(redisClient *c, long long basetime, int unit) { ...@@ -912,7 +912,8 @@ void expireGenericCommand(redisClient *c, long long basetime, int unit) {
} }
void expireCommand(redisClient *c) { 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) { void expireatCommand(redisClient *c) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment