This commit is contained in:
weisd
2025-07-01 13:05:33 +08:00
parent 18a3902d2c
commit ddf19b3444
5 changed files with 8 additions and 7 deletions

View File

@@ -1,8 +1,8 @@
use super::pattern;
use super::target_id_set::TargetIdSet;
use crate::arn::TargetID;
use std::collections::HashMap;
use serde::{Deserialize, Serialize};
use std::collections::HashMap;
/// PatternRules - Event rule that maps object name patterns to TargetID collections.
/// `event.Rules` (map[string]TargetIDSet) in the Go code

View File

@@ -1136,7 +1136,6 @@ impl FromStr for ReplicationAction {
// }
// }
// 忽略大小写比较字符串列表
// fn equals(k1: &str, keys: &[&str]) -> bool {
// keys.iter().any(|&k2| k1.eq_ignore_ascii_case(k2))

View File

@@ -759,7 +759,10 @@ impl ScannerItem {
let replication = match metadata_sys::get_replication_config(&oi.bucket).await {
Ok((replication, _)) => replication,
Err(_) => {
error!("heal_replication: failed to get replication config for bucket: {} and object name: {}", oi.bucket, oi.name);
error!(
"heal_replication: failed to get replication config for bucket: {} and object name: {}",
oi.bucket, oi.name
);
return;
}
};

View File

@@ -3,9 +3,9 @@ use crate::auth::{check_key_valid, get_session_token};
use http::{HeaderMap, StatusCode};
use matchit::Params;
use rustfs_config::notify::{NOTIFY_MQTT_SUB_SYS, NOTIFY_WEBHOOK_SUB_SYS};
use rustfs_notify::rules::{BucketNotificationConfig, PatternRules};
use rustfs_notify::EventName;
use s3s::{header::CONTENT_TYPE, s3_error, Body, S3Error, S3ErrorCode, S3Request, S3Response, S3Result};
use rustfs_notify::rules::{BucketNotificationConfig, PatternRules};
use s3s::{Body, S3Error, S3ErrorCode, S3Request, S3Response, S3Result, header::CONTENT_TYPE, s3_error};
use serde::{Deserialize, Serialize};
use serde_urlencoded::from_bytes;
use std::collections::HashMap;
@@ -35,7 +35,7 @@ impl Operation for SetNotificationTarget {
.map_err(|e| s3_error!(InvalidArgument, "invalid query parameters: {}", e))?;
let target_type = query.target_type.to_lowercase();
if target_type != NOTIFY_WEBHOOK_SUB_SYS.to_string() && target_type != NOTIFY_MQTT_SUB_SYS.to_string() {
if target_type != *NOTIFY_WEBHOOK_SUB_SYS && target_type != *NOTIFY_MQTT_SUB_SYS {
return Err(s3_error!(InvalidArgument, "unsupported target type: {}", query.target_type));
}

View File

@@ -151,7 +151,6 @@ async fn run(opt: config::Opt) -> Result<()> {
eps.drives_per_set
);
// Add warning for host with multiple drives in a set (similar to RustFS)
if eps.drives_per_set > 1 {
warn!("WARNING: Host local has more than 0 drives of set. A host failure will result in data becoming unavailable.");
}