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.
This commit is contained in:
antirez 2015-05-04 12:01:39 +02:00
parent 27db456332
commit d57ac2c872
1 changed files with 2 additions and 1 deletions

View File

@ -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) {