mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-13 16:46:55 +00:00
add
This commit is contained in:
+11
-1
@@ -8,7 +8,7 @@ pub(crate) async fn init_event_notifier(notifier_config: Option<String>) {
|
||||
info!("event_config is not empty");
|
||||
tokio::spawn(async move {
|
||||
let config = NotifierConfig::event_load_config(notifier_config);
|
||||
let result = rustfs_event::initialize(config).await;
|
||||
let result = rustfs_event::initialize(&config).await;
|
||||
if let Err(e) = result {
|
||||
error!("Failed to initialize event notifier: {}", e);
|
||||
} else {
|
||||
@@ -17,5 +17,15 @@ pub(crate) async fn init_event_notifier(notifier_config: Option<String>) {
|
||||
});
|
||||
} else {
|
||||
info!("event_config is empty");
|
||||
tokio::spawn(async move {
|
||||
let config = rustfs_event::get_event_notifier_config();
|
||||
info!("event_config is {:?}", config);
|
||||
let result = rustfs_event::initialize(config).await;
|
||||
if let Err(e) = result {
|
||||
error!("Failed to initialize event notifier: {}", e);
|
||||
} else {
|
||||
info!("Event notifier initialized successfully");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
+7
-1
@@ -48,6 +48,7 @@ use iam::init_iam_sys;
|
||||
use license::init_license;
|
||||
use protos::proto_gen::node_service::node_service_server::NodeServiceServer;
|
||||
use rustfs_config::{DEFAULT_ACCESS_KEY, DEFAULT_SECRET_KEY, RUSTFS_TLS_CERT, RUSTFS_TLS_KEY};
|
||||
use rustfs_event::GLOBAL_EventSys;
|
||||
use rustfs_obs::{init_obs, init_process_observer, load_config, set_global_guard};
|
||||
use rustls::ServerConfig;
|
||||
use s3s::{host::MultiDomain, service::S3ServiceBuilder};
|
||||
@@ -118,7 +119,7 @@ async fn run(opt: config::Opt) -> Result<()> {
|
||||
debug!("opt: {:?}", &opt);
|
||||
|
||||
// Initialize event notifier
|
||||
event::init_event_notifier(opt.event_config).await;
|
||||
// event::init_event_notifier(opt.event_config).await;
|
||||
|
||||
let server_addr = net::parse_and_resolve_address(opt.address.as_str())?;
|
||||
let server_port = server_addr.port();
|
||||
@@ -507,6 +508,11 @@ async fn run(opt: config::Opt) -> Result<()> {
|
||||
ecconfig::init();
|
||||
GLOBAL_ConfigSys.init(store.clone()).await?;
|
||||
|
||||
GLOBAL_EventSys.init(store.clone()).await?;
|
||||
|
||||
// Initialize event notifier
|
||||
event::init_event_notifier(opt.event_config).await;
|
||||
|
||||
let buckets_list = store
|
||||
.list_bucket(&BucketOptions {
|
||||
no_metadata: true,
|
||||
|
||||
Reference in New Issue
Block a user