From 7f04964d5b7017f8f71395ebd0fb30d00d52179a Mon Sep 17 00:00:00 2001 From: "lvyanqi.lyq" Date: Fri, 15 Nov 2024 14:27:52 +0800 Subject: [PATCH] minor refactor Signed-off-by: lvyanqi.lyq --- src/server.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/server.c b/src/server.c index 3c23bde71b..73fdf23538 100644 --- a/src/server.c +++ b/src/server.c @@ -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); } }