mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-13 08:36:54 +00:00
modify crates name
This commit is contained in:
+1
-1
@@ -53,7 +53,7 @@ protos.workspace = true
|
||||
query = { workspace = true }
|
||||
rmp-serde.workspace = true
|
||||
rustfs-config = { workspace = true }
|
||||
rustfs-event = { workspace = true }
|
||||
rustfs-notify = { workspace = true }
|
||||
rustfs-obs = { workspace = true }
|
||||
rustfs-utils = { workspace = true, features = ["full"] }
|
||||
rustls.workspace = true
|
||||
|
||||
+16
-15
@@ -1,4 +1,5 @@
|
||||
use rustfs_event::NotifierConfig;
|
||||
use rustfs_config::NotifierConfig;
|
||||
use rustfs_event::EventNotifierConfig;
|
||||
use tracing::{error, info, instrument};
|
||||
|
||||
#[instrument]
|
||||
@@ -7,26 +8,26 @@ pub(crate) async fn init_event_notifier(notifier_config: Option<String>) {
|
||||
let notifier_config_present = notifier_config.is_some();
|
||||
let config = if notifier_config_present {
|
||||
info!("event_config is not empty, path: {:?}", notifier_config);
|
||||
NotifierConfig::event_load_config(notifier_config)
|
||||
EventNotifierConfig::event_load_config(notifier_config)
|
||||
} else {
|
||||
info!("event_config is empty");
|
||||
// rustfs_event::get_event_notifier_config().clone()
|
||||
NotifierConfig::default()
|
||||
EventNotifierConfig::default()
|
||||
};
|
||||
|
||||
info!("using event_config: {:?}", config);
|
||||
tokio::spawn(async move {
|
||||
let result = rustfs_event::initialize(&config).await;
|
||||
match result {
|
||||
Ok(_) => info!(
|
||||
"event notifier initialized successfully {}",
|
||||
if notifier_config_present {
|
||||
"by config file"
|
||||
} else {
|
||||
"by sys config"
|
||||
}
|
||||
),
|
||||
Err(e) => error!("Failed to initialize event notifier: {}", e),
|
||||
}
|
||||
// let result = rustfs_event::initialize(&config).await;
|
||||
// match result {
|
||||
// Ok(_) => info!(
|
||||
// "event notifier initialized successfully {}",
|
||||
// if notifier_config_present {
|
||||
// "by config file"
|
||||
// } else {
|
||||
// "by sys config"
|
||||
// }
|
||||
// ),
|
||||
// Err(e) => error!("Failed to initialize event notifier: {}", e),
|
||||
// }
|
||||
});
|
||||
}
|
||||
|
||||
+8
-8
@@ -569,14 +569,14 @@ async fn run(opt: config::Opt) -> Result<()> {
|
||||
// update the status to stopping first
|
||||
state_manager.update(ServiceState::Stopping);
|
||||
|
||||
// Stop the notification system
|
||||
if rustfs_event::is_ready() {
|
||||
// stop event notifier
|
||||
rustfs_event::shutdown().await.map_err(|err| {
|
||||
error!("Failed to shut down the notification system: {}", err);
|
||||
Error::from_string(err.to_string())
|
||||
})?;
|
||||
}
|
||||
// // Stop the notification system
|
||||
// if rustfs_event::is_ready() {
|
||||
// // stop event notifier
|
||||
// rustfs_event::shutdown().await.map_err(|err| {
|
||||
// error!("Failed to shut down the notification system: {}", err);
|
||||
// Error::from_string(err.to_string())
|
||||
// })?;
|
||||
// }
|
||||
|
||||
info!("Server is stopping...");
|
||||
let _ = shutdown_tx.send(());
|
||||
|
||||
@@ -13,5 +13,6 @@ pub(crate) fn create_metadata() -> Metadata {
|
||||
/// Create a new event object
|
||||
#[allow(dead_code)]
|
||||
pub(crate) async fn send_event(event: Event) -> Result<(), Box<dyn std::error::Error>> {
|
||||
rustfs_event::send_event(event).await.map_err(|e| e.into())
|
||||
// rustfs_event::send_event(event).await.map_err(|e| e.into())
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user