refactor region parsing (#1981)

This commit is contained in:
heihutu
2026-02-27 02:34:09 +08:00
committed by GitHub
parent d983638391
commit c32b6f2f37
+4 -4
View File
@@ -163,11 +163,11 @@ async fn run(config: config::Config) -> Result<()> {
// 1. Initialize global readiness tracker
let readiness = Arc::new(GlobalReadiness::new());
if let Some(region) = &config.region {
let region = region
if let Some(region_str) = &config.region {
region_str
.parse()
.map_err(|e| Error::other(format!("invalid region {}: {e}", region)))?;
rustfs_ecstore::global::set_global_region(region);
.map(rustfs_ecstore::global::set_global_region)
.map_err(|e| Error::other(format!("invalid region '{}': {}", region_str, e)))?;
}
let server_addr = parse_and_resolve_address(config.address.as_str()).map_err(Error::other)?;