From 3df7105dae73795fe5236350d13754793bc0fab5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=89=E6=AD=A3=E8=B6=85?= Date: Tue, 10 Mar 2026 23:52:40 +0800 Subject: [PATCH] fix(server): init event notifier when partial notify configured (#2125) --- rustfs/src/server/event.rs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/rustfs/src/server/event.rs b/rustfs/src/server/event.rs index ae84d5ce2..85b8573c8 100644 --- a/rustfs/src/server/event.rs +++ b/rustfs/src/server/event.rs @@ -62,14 +62,15 @@ pub(crate) async fn init_event_notifier() { target: "rustfs::main::init_event_notifier", "Global server configuration loaded successfully" ); - // 2. Check if the notify subsystem exists in the configuration, and skip initialization if it doesn't - if server_config + // 2. Check if at least one notify subsystem exists in the configuration, and skip only when neither is present. + let mqtt_configured = server_config .get_value(rustfs_config::notify::NOTIFY_MQTT_SUB_SYS, DEFAULT_DELIMITER) - .is_none() - || server_config - .get_value(rustfs_config::notify::NOTIFY_WEBHOOK_SUB_SYS, DEFAULT_DELIMITER) - .is_none() - { + .is_some(); + let webhook_configured = server_config + .get_value(rustfs_config::notify::NOTIFY_WEBHOOK_SUB_SYS, DEFAULT_DELIMITER) + .is_some(); + + if !mqtt_configured && !webhook_configured { info!( target: "rustfs::main::init_event_notifier", "'notify' subsystem not configured, skipping event notifier initialization."