mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-30 08:49:26 +00:00
refactor region parsing (#1981)
This commit is contained in:
+4
-4
@@ -163,11 +163,11 @@ async fn run(config: config::Config) -> Result<()> {
|
|||||||
// 1. Initialize global readiness tracker
|
// 1. Initialize global readiness tracker
|
||||||
let readiness = Arc::new(GlobalReadiness::new());
|
let readiness = Arc::new(GlobalReadiness::new());
|
||||||
|
|
||||||
if let Some(region) = &config.region {
|
if let Some(region_str) = &config.region {
|
||||||
let region = region
|
region_str
|
||||||
.parse()
|
.parse()
|
||||||
.map_err(|e| Error::other(format!("invalid region {}: {e}", region)))?;
|
.map(rustfs_ecstore::global::set_global_region)
|
||||||
rustfs_ecstore::global::set_global_region(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)?;
|
let server_addr = parse_and_resolve_address(config.address.as_str()).map_err(Error::other)?;
|
||||||
|
|||||||
Reference in New Issue
Block a user