]> git.saurik.com Git - redis.git/commitdiff
EXPIRE behaviour changed a bit, a negative TTL or an EXPIREAT with unix time in the...
authorantirez <antirez@gmail.com>
Thu, 29 Oct 2009 23:21:04 +0000 (00:21 +0100)
committerantirez <antirez@gmail.com>
Thu, 29 Oct 2009 23:21:04 +0000 (00:21 +0100)
redis.c

diff --git a/redis.c b/redis.c
index 86a06af16a728ce3065a5475da6f4e2bd8f63260..0040483a62801de0905003c8772ecc1a9a0081c7 100644 (file)
--- a/redis.c
+++ b/redis.c
@@ -4746,8 +4746,9 @@ static void expireGenericCommand(redisClient *c, robj *key, time_t seconds) {
         addReply(c,shared.czero);
         return;
     }
-    if (seconds <= 0) {
-        addReply(c, shared.czero);
+    if (seconds < 0) {
+        if (deleteKey(c->db,key)) server.dirty++;
+        addReply(c, shared.cone);
         return;
     } else {
         time_t when = time(NULL)+seconds;