summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2011-01-14 09:53:57 +0100
committerantirez <antirez@gmail.com>2011-01-14 09:54:41 +0100
commit360664c9c8da2cbacc5000d7a058c754a36f8ec7 (patch)
tree9ab275b13502aca47219e3dd9d6a4aa1cc1a6d52
parentf487bbbfe2222986ccf9674e6714c7dd506a5a16 (diff)
downloadredis-360664c9c8da2cbacc5000d7a058c754a36f8ec7.tar.gz
master-slave replication fixed, it was not listing any key using KEYS command in the slave.
-rw-r--r--src/db.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/db.c b/src/db.c
index aa1c14ad4..ede242dbe 100644
--- a/src/db.c
+++ b/src/db.c
@@ -453,6 +453,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.
@@ -464,8 +466,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;