]> git.saurik.com Git - redis.git/commitdiff
TTL command fixed to work reliably with diskstore
authorantirez <antirez@gmail.com>
Fri, 4 Mar 2011 14:49:01 +0000 (15:49 +0100)
committerantirez <antirez@gmail.com>
Fri, 4 Mar 2011 14:49:01 +0000 (15:49 +0100)
src/db.c

index 669fba13e8e7d7f6b12494920ef965ec735f372a..9daa5ddbd8a3da2c17f8465b7c5ac774e26b901a 100644 (file)
--- a/src/db.c
+++ b/src/db.c
@@ -592,6 +592,7 @@ void expireatCommand(redisClient *c) {
 void ttlCommand(redisClient *c) {
     time_t expire, ttl = -1;
 
+    if (server.ds_enabled) lookupKeyRead(c->db,c->argv[1]);
     expire = getExpire(c->db,c->argv[1]);
     if (expire != -1) {
         ttl = (expire-time(NULL));