mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-25 21:46:50 +00:00
@@ -1,3 +1,4 @@
|
|||||||
|
use futures::future::join_all;
|
||||||
use madmin::heal_commands::HealResultItem;
|
use madmin::heal_commands::HealResultItem;
|
||||||
use std::{cmp::Ordering, env, path::PathBuf, sync::Arc, time::Duration};
|
use std::{cmp::Ordering, env, path::PathBuf, sync::Arc, time::Duration};
|
||||||
use tokio::{
|
use tokio::{
|
||||||
@@ -118,9 +119,10 @@ async fn monitor_local_disks_and_heal() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let mut futures = Vec::new();
|
||||||
for disk in heal_disks.into_ref().iter() {
|
for disk in heal_disks.into_ref().iter() {
|
||||||
let disk_clone = disk.clone();
|
let disk_clone = disk.clone();
|
||||||
spawn(async move {
|
futures.push(async move {
|
||||||
GLOBAL_BackgroundHealState
|
GLOBAL_BackgroundHealState
|
||||||
.set_disk_healing_status(disk_clone.clone(), true)
|
.set_disk_healing_status(disk_clone.clone(), true)
|
||||||
.await;
|
.await;
|
||||||
@@ -133,6 +135,7 @@ async fn monitor_local_disks_and_heal() {
|
|||||||
GLOBAL_BackgroundHealState.pop_heal_local_disks(&[disk_clone]).await;
|
GLOBAL_BackgroundHealState.pop_heal_local_disks(&[disk_clone]).await;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
let _ = join_all(futures).await;
|
||||||
interval.reset();
|
interval.reset();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user