Initial support for key expire times with millisecond resolution. RDB version is now 3, new opcoded added for high resolution times. Redis is still able to correctly load RDB version 2. Tests passing but still a work in progress. API to specify milliseconds expires still missing, but the precision of normal expires is now already improved and working.

This commit is contained in:
antirez
2011-11-09 16:51:19 +01:00
parent 14ed10d957
commit 7dcc10b65e
6 changed files with 76 additions and 39 deletions

View File

@ -30,7 +30,7 @@ void setGenericCommand(redisClient *c, int nx, robj *key, robj *val, robj *expir
}
setKey(c->db,key,val);
server.dirty++;
if (expire) setExpire(c->db,key,time(NULL)+seconds);
if (expire) setExpire(c->db,key,(time(NULL)+seconds)*1000);
addReply(c, nx ? shared.cone : shared.ok);
}