mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-12 16:16:55 +00:00
Fix/fix event 1216 (#1191)
Signed-off-by: loverustfs <hello@rustfs.com> Co-authored-by: loverustfs <hello@rustfs.com>
This commit is contained in:
+1
-2
@@ -16,9 +16,8 @@ mod admin;
|
||||
mod auth;
|
||||
mod config;
|
||||
mod error;
|
||||
// mod grpc;
|
||||
mod init;
|
||||
pub mod license;
|
||||
mod license;
|
||||
mod profiling;
|
||||
mod server;
|
||||
mod storage;
|
||||
|
||||
@@ -12,8 +12,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
use rustfs_audit::system::AuditSystemState;
|
||||
use rustfs_audit::{AuditError, AuditResult, audit_system, init_audit_system};
|
||||
use rustfs_audit::{AuditError, AuditResult, audit_system, init_audit_system, system::AuditSystemState};
|
||||
use rustfs_config::DEFAULT_DELIMITER;
|
||||
use rustfs_ecstore::config::GLOBAL_SERVER_CONFIG;
|
||||
use tracing::{info, warn};
|
||||
@@ -69,7 +68,9 @@ pub(crate) async fn start_audit_system() -> AuditResult<()> {
|
||||
mqtt_config.is_some(),
|
||||
webhook_config.is_some()
|
||||
);
|
||||
// 3. Initialize and start the audit system
|
||||
let system = init_audit_system();
|
||||
// Check if the audit system is already running
|
||||
let state = system.get_state().await;
|
||||
if state == AuditSystemState::Running {
|
||||
warn!(
|
||||
|
||||
@@ -5122,6 +5122,7 @@ impl S3 for FS {
|
||||
let (clear_result, event_rules) = tokio::join!(clear_rules, parse_rules);
|
||||
|
||||
clear_result.map_err(|e| s3_error!(InternalError, "Failed to clear rules: {e}"))?;
|
||||
warn!("notify event rules: {:?}", &event_rules);
|
||||
|
||||
// Add a new notification rule
|
||||
notifier_global::add_event_specific_rules(&bucket, ®ion, &event_rules)
|
||||
|
||||
@@ -16,7 +16,7 @@ use bytes::Bytes;
|
||||
use futures::Stream;
|
||||
use futures_util::future::join_all;
|
||||
use rmp_serde::{Deserializer, Serializer};
|
||||
use rustfs_common::{globals::GLOBAL_Local_Node_Name, heal_channel::HealOpts};
|
||||
use rustfs_common::{globals::GLOBAL_LOCAL_NODE_NAME, heal_channel::HealOpts};
|
||||
use rustfs_ecstore::{
|
||||
admin_server_info::get_local_server_property,
|
||||
bucket::{metadata::load_bucket_metadata, metadata_sys},
|
||||
@@ -1646,7 +1646,7 @@ impl Node for NodeService {
|
||||
}
|
||||
|
||||
async fn get_net_info(&self, _request: Request<GetNetInfoRequest>) -> Result<Response<GetNetInfoResponse>, Status> {
|
||||
let addr = GLOBAL_Local_Node_Name.read().await.clone();
|
||||
let addr = GLOBAL_LOCAL_NODE_NAME.read().await.clone();
|
||||
let info = get_net_info(&addr, "");
|
||||
let mut buf = Vec::new();
|
||||
if let Err(err) = info.serialize(&mut Serializer::new(&mut buf)) {
|
||||
@@ -1701,7 +1701,7 @@ impl Node for NodeService {
|
||||
&self,
|
||||
_request: Request<GetSeLinuxInfoRequest>,
|
||||
) -> Result<Response<GetSeLinuxInfoResponse>, Status> {
|
||||
let addr = GLOBAL_Local_Node_Name.read().await.clone();
|
||||
let addr = GLOBAL_LOCAL_NODE_NAME.read().await.clone();
|
||||
let info = get_sys_services(&addr);
|
||||
let mut buf = Vec::new();
|
||||
if let Err(err) = info.serialize(&mut Serializer::new(&mut buf)) {
|
||||
@@ -1719,7 +1719,7 @@ impl Node for NodeService {
|
||||
}
|
||||
|
||||
async fn get_sys_config(&self, _request: Request<GetSysConfigRequest>) -> Result<Response<GetSysConfigResponse>, Status> {
|
||||
let addr = GLOBAL_Local_Node_Name.read().await.clone();
|
||||
let addr = GLOBAL_LOCAL_NODE_NAME.read().await.clone();
|
||||
let info = get_sys_config(&addr);
|
||||
let mut buf = Vec::new();
|
||||
if let Err(err) = info.serialize(&mut Serializer::new(&mut buf)) {
|
||||
@@ -1737,7 +1737,7 @@ impl Node for NodeService {
|
||||
}
|
||||
|
||||
async fn get_sys_errors(&self, _request: Request<GetSysErrorsRequest>) -> Result<Response<GetSysErrorsResponse>, Status> {
|
||||
let addr = GLOBAL_Local_Node_Name.read().await.clone();
|
||||
let addr = GLOBAL_LOCAL_NODE_NAME.read().await.clone();
|
||||
let info = get_sys_errors(&addr);
|
||||
let mut buf = Vec::new();
|
||||
if let Err(err) = info.serialize(&mut Serializer::new(&mut buf)) {
|
||||
@@ -1755,7 +1755,7 @@ impl Node for NodeService {
|
||||
}
|
||||
|
||||
async fn get_mem_info(&self, _request: Request<GetMemInfoRequest>) -> Result<Response<GetMemInfoResponse>, Status> {
|
||||
let addr = GLOBAL_Local_Node_Name.read().await.clone();
|
||||
let addr = GLOBAL_LOCAL_NODE_NAME.read().await.clone();
|
||||
let info = get_mem_info(&addr);
|
||||
let mut buf = Vec::new();
|
||||
if let Err(err) = info.serialize(&mut Serializer::new(&mut buf)) {
|
||||
@@ -1798,7 +1798,7 @@ impl Node for NodeService {
|
||||
}
|
||||
|
||||
async fn get_proc_info(&self, _request: Request<GetProcInfoRequest>) -> Result<Response<GetProcInfoResponse>, Status> {
|
||||
let addr = GLOBAL_Local_Node_Name.read().await.clone();
|
||||
let addr = GLOBAL_LOCAL_NODE_NAME.read().await.clone();
|
||||
let info = get_proc_info(&addr);
|
||||
let mut buf = Vec::new();
|
||||
if let Err(err) = info.serialize(&mut Serializer::new(&mut buf)) {
|
||||
|
||||
Reference in New Issue
Block a user