Commit d57ac2c8 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 27db4563
......@@ -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) {
......
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