mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-31 09:18:28 +00:00
@@ -30,13 +30,7 @@ pub struct Endpoint {
|
|||||||
impl Display for Endpoint {
|
impl Display for Endpoint {
|
||||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||||
if self.url.scheme() == "file" {
|
if self.url.scheme() == "file" {
|
||||||
write!(
|
write!(f, "{}", self.url.path())
|
||||||
f,
|
|
||||||
"{}",
|
|
||||||
fs::canonicalize(self.url.path())
|
|
||||||
.map_err(|_| std::fmt::Error)?
|
|
||||||
.to_string_lossy()
|
|
||||||
)
|
|
||||||
} else {
|
} else {
|
||||||
write!(f, "{}", self.url)
|
write!(f, "{}", self.url)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -206,7 +206,7 @@ impl ECStore {
|
|||||||
if !is_dist_erasure().await {
|
if !is_dist_erasure().await {
|
||||||
let mut global_local_disk_map = GLOBAL_LOCAL_DISK_MAP.write().await;
|
let mut global_local_disk_map = GLOBAL_LOCAL_DISK_MAP.write().await;
|
||||||
for disk in local_disks {
|
for disk in local_disks {
|
||||||
let path = disk.path().to_string_lossy().to_string();
|
let path = disk.endpoint().to_string();
|
||||||
global_local_disk_map.insert(path, Some(disk.clone()));
|
global_local_disk_map.insert(path, Some(disk.clone()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -992,7 +992,7 @@ pub async fn init_local_disks(endpoint_pools: EndpointServerPools) -> Result<()>
|
|||||||
|
|
||||||
let disk = new_disk(ep, opt).await?;
|
let disk = new_disk(ep, opt).await?;
|
||||||
|
|
||||||
let path = disk.path().to_string_lossy().to_string();
|
let path = disk.endpoint().to_string();
|
||||||
|
|
||||||
global_local_disk_map.insert(path, Some(disk.clone()));
|
global_local_disk_map.insert(path, Some(disk.clone()));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user