mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-10 23:26:53 +00:00
improve code for notify
This commit is contained in:
@@ -23,7 +23,7 @@ use tracing::warn;
|
||||
|
||||
pub const RPC_PREFIX: &str = "/rustfs/rpc";
|
||||
|
||||
pub fn regist_rpc_route(r: &mut S3Router<AdminOperation>) -> std::io::Result<()> {
|
||||
pub fn register_rpc_route(r: &mut S3Router<AdminOperation>) -> std::io::Result<()> {
|
||||
r.insert(
|
||||
Method::GET,
|
||||
format!("{}{}", RPC_PREFIX, "/read_file_stream").as_str(),
|
||||
|
||||
+3
-3
@@ -1,4 +1,4 @@
|
||||
use rustfs_notify::EventNotifierConfig;
|
||||
// use rustfs_notify::EventNotifierConfig;
|
||||
use tracing::{info, instrument};
|
||||
|
||||
#[instrument]
|
||||
@@ -7,11 +7,11 @@ 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);
|
||||
EventNotifierConfig::event_load_config(notifier_config)
|
||||
// EventNotifierConfig::event_load_config(notifier_config)
|
||||
} else {
|
||||
info!("event_config is empty");
|
||||
// rustfs_notify::get_event_notifier_config().clone()
|
||||
EventNotifierConfig::default()
|
||||
// EventNotifierConfig::default()
|
||||
};
|
||||
|
||||
info!("using event_config: {:?}", config);
|
||||
|
||||
@@ -1,18 +1 @@
|
||||
use rustfs_notify::{Event, Metadata};
|
||||
|
||||
/// Create a new metadata object
|
||||
#[allow(dead_code)]
|
||||
pub(crate) fn create_metadata() -> Metadata {
|
||||
// Create a new metadata object
|
||||
let mut metadata = Metadata::new();
|
||||
metadata.set_configuration_id("test-config".to_string());
|
||||
// Return the created metadata object
|
||||
metadata
|
||||
}
|
||||
|
||||
/// Create a new event object
|
||||
#[allow(dead_code)]
|
||||
pub(crate) async fn send_event(event: Event) -> Result<(), Box<dyn std::error::Error>> {
|
||||
// rustfs_notify::send_event(event).await.map_err(|e| e.into())
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user