Commit 15db4aa0 authored by antirez's avatar antirez
Browse files

TTL command fixed to work reliably with diskstore

parent 8b108ed3
...@@ -592,6 +592,7 @@ void expireatCommand(redisClient *c) { ...@@ -592,6 +592,7 @@ void expireatCommand(redisClient *c) {
void ttlCommand(redisClient *c) { void ttlCommand(redisClient *c) {
time_t expire, ttl = -1; time_t expire, ttl = -1;
if (server.ds_enabled) lookupKeyRead(c->db,c->argv[1]);
expire = getExpire(c->db,c->argv[1]); expire = getExpire(c->db,c->argv[1]);
if (expire != -1) { if (expire != -1) {
ttl = (expire-time(NULL)); ttl = (expire-time(NULL));
......
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