Skip to content

Commit

Permalink
minor refactor
Browse files Browse the repository at this point in the history
Signed-off-by: lvyanqi.lyq <lvyanqi.lyq@alibaba-inc.com>
  • Loading branch information
lyq2333 committed Nov 15, 2024
1 parent 20b005c commit 7f04964
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/server.c
Original file line number Diff line number Diff line change
Expand Up @@ -1055,12 +1055,10 @@ void databasesCron(void) {
/* Expire keys by random sampling. Not required for replicas
* as primary will synthesize DELs for us. */
if (server.active_expire_enabled) {
if (iAmPrimary()) {
if (!server.import_mode) {
activeExpireCycle(ACTIVE_EXPIRE_CYCLE_SLOW);
}
} else {
if (!iAmPrimary()) {
expireReplicaKeys();
} else if (!server.import_mode) {
activeExpireCycle(ACTIVE_EXPIRE_CYCLE_SLOW);
}
}

Expand Down

0 comments on commit 7f04964

Please sign in to comment.