Commit 72420b0d authored by WuYunlong's avatar WuYunlong Committed by antirez
Browse files

Do not active expire keys in the background when the switch is off.

parent 33a50d24
...@@ -1000,11 +1000,13 @@ void clientsCron(void) { ...@@ -1000,11 +1000,13 @@ void clientsCron(void) {
void databasesCron(void) { void databasesCron(void) {
/* Expire keys by random sampling. Not required for slaves /* Expire keys by random sampling. Not required for slaves
* as master will synthesize DELs for us. */ * as master will synthesize DELs for us. */
if (server.active_expire_enabled && server.masterhost == NULL) { if (server.active_expire_enabled) {
if (server.masterhost == NULL) {
activeExpireCycle(ACTIVE_EXPIRE_CYCLE_SLOW); activeExpireCycle(ACTIVE_EXPIRE_CYCLE_SLOW);
} else if (server.masterhost != NULL) { } else {
expireSlaveKeys(); expireSlaveKeys();
} }
}
/* Defrag keys gradually. */ /* Defrag keys gradually. */
if (server.active_defrag_enabled) if (server.active_defrag_enabled)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment