diff options
author | WuYunlong <xzsyeb@126.com> | 2019-05-06 11:46:07 +0800 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2019-05-13 16:37:49 +0200 |
commit | 72420b0d7a7c6e3efc1e2df1f1e4b46610e031c0 (patch) | |
tree | 8eacb6794253a7008d63ea223e0e4cf27ab1ed18 | |
parent | 33a50d24a5d0f0e09e71e52d7322eb7a1532ea74 (diff) | |
download | redis-72420b0d7a7c6e3efc1e2df1f1e4b46610e031c0.tar.gz |
Do not active expire keys in the background when the switch is off.
-rw-r--r-- | src/server.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/server.c b/src/server.c index 4f0045b32..7f0acaa5d 100644 --- a/src/server.c +++ b/src/server.c @@ -1000,10 +1000,12 @@ void clientsCron(void) { void databasesCron(void) { /* Expire keys by random sampling. Not required for slaves * as master will synthesize DELs for us. */ - if (server.active_expire_enabled && server.masterhost == NULL) { - activeExpireCycle(ACTIVE_EXPIRE_CYCLE_SLOW); - } else if (server.masterhost != NULL) { - expireSlaveKeys(); + if (server.active_expire_enabled) { + if (server.masterhost == NULL) { + activeExpireCycle(ACTIVE_EXPIRE_CYCLE_SLOW); + } else { + expireSlaveKeys(); + } } /* Defrag keys gradually. */ |