X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/69bfffb4a7aec38e5079ec10b0acc8629c1ee82b..3a73be752476f44dfb099863ac9424c2f27f2be0:/src/db.c?ds=inline diff --git a/src/db.c b/src/db.c index 1f321c01..669fba13 100644 --- a/src/db.c +++ b/src/db.c @@ -527,6 +527,8 @@ void propagateExpire(redisDb *db, robj *key) { int expireIfNeeded(redisDb *db, robj *key) { time_t when = getExpire(db,key); + if (when < 0) return 0; /* No expire for this key */ + /* If we are running in the context of a slave, return ASAP: * the slave key expiration is controlled by the master that will * send us synthesized DEL operations for expired keys. @@ -538,8 +540,6 @@ int expireIfNeeded(redisDb *db, robj *key) { return time(NULL) > when; } - if (when < 0) return 0; - /* Return when this key has not expired */ if (time(NULL) <= when) return 0;