TTL command fixed to work reliably with diskstore

This commit is contained in:
antirez 2011-03-04 15:49:01 +01:00
parent 8b108ed307
commit 15db4aa006

View File

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