mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-22 16:18:28 -05:00
master-slave replication fixed, it was not listing any key using KEYS command in the slave.
This commit is contained in:
parent
5b831607e7
commit
3a73be7524
4
src/db.c
4
src/db.c
@ -527,6 +527,8 @@ void propagateExpire(redisDb *db, robj *key) {
|
|||||||
int expireIfNeeded(redisDb *db, robj *key) {
|
int expireIfNeeded(redisDb *db, robj *key) {
|
||||||
time_t when = getExpire(db,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:
|
/* If we are running in the context of a slave, return ASAP:
|
||||||
* the slave key expiration is controlled by the master that will
|
* the slave key expiration is controlled by the master that will
|
||||||
* send us synthesized DEL operations for expired keys.
|
* send us synthesized DEL operations for expired keys.
|
||||||
@ -538,8 +540,6 @@ int expireIfNeeded(redisDb *db, robj *key) {
|
|||||||
return time(NULL) > when;
|
return time(NULL) > when;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (when < 0) return 0;
|
|
||||||
|
|
||||||
/* Return when this key has not expired */
|
/* Return when this key has not expired */
|
||||||
if (time(NULL) <= when) return 0;
|
if (time(NULL) <= when) return 0;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user