From 57f0370ab802afacbad1a7614f7b4e5f929d0d63 Mon Sep 17 00:00:00 2001 From: junxiang Mu <1948535941@qq.com> Date: Thu, 26 Dec 2024 16:25:13 +0800 Subject: [PATCH] tmp1 Signed-off-by: junxiang Mu <1948535941@qq.com> --- ecstore/src/heal/background_heal_ops.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ecstore/src/heal/background_heal_ops.rs b/ecstore/src/heal/background_heal_ops.rs index 7cd54ee34..74821f9f6 100644 --- a/ecstore/src/heal/background_heal_ops.rs +++ b/ecstore/src/heal/background_heal_ops.rs @@ -1,3 +1,4 @@ +use futures::future::join_all; use madmin::heal_commands::HealResultItem; use std::{cmp::Ordering, env, path::PathBuf, sync::Arc, time::Duration}; 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() { let disk_clone = disk.clone(); - spawn(async move { + futures.push(async move { GLOBAL_BackgroundHealState .set_disk_healing_status(disk_clone.clone(), true) .await; @@ -133,6 +135,7 @@ async fn monitor_local_disks_and_heal() { GLOBAL_BackgroundHealState.pop_heal_local_disks(&[disk_clone]).await; }); } + let _ = join_all(futures).await; interval.reset(); } }