diff --git a/ecstore/src/heal/data_scanner.rs b/ecstore/src/heal/data_scanner.rs index 2a6ba54f0..c6b1072e5 100644 --- a/ecstore/src/heal/data_scanner.rs +++ b/ecstore/src/heal/data_scanner.rs @@ -514,7 +514,9 @@ impl FolderScanner { let this_hash = hash_path(&folder.name); let was_compacted = into.compacted; - loop { + // do not really loop + let mut times = 1; + while times > 0 { let mut abandoned_children: DataUsageHashMap = if !into.compacted { self.old_cache.find_children_copy(this_hash.clone()) } else { @@ -902,7 +904,7 @@ impl FolderScanner { scan(&this, into, self).await; } } - break; + times -= 1; } if !was_compacted { self.new_cache.replace_hashed(&this_hash, &Some(folder.parent.clone()), into); diff --git a/ecstore/src/heal/heal_ops.rs b/ecstore/src/heal/heal_ops.rs index 8cfcae7e0..e6e5dfb85 100644 --- a/ecstore/src/heal/heal_ops.rs +++ b/ecstore/src/heal/heal_ops.rs @@ -326,44 +326,40 @@ impl HealSequence { count }; - loop { - match resp_rx.recv().await { - Some(mut res) => { - if res.err.is_none() { - self.count_healed(heal_type.clone()); - } else { - self.count_failed(heal_type.clone()); - } - if !self.report_progress { - if let Some(err) = res.err { - if err.to_string() == ERR_SKIP_FILE { - return Ok(()); - } - return Err(err); - } else { + match resp_rx.recv().await { + Some(mut res) => { + if res.err.is_none() { + self.count_healed(heal_type.clone()); + } else { + self.count_failed(heal_type.clone()); + } + if !self.report_progress { + if let Some(err) = res.err { + if err.to_string() == ERR_SKIP_FILE { return Ok(()); } + return Err(err); + } else { + return Ok(()); } - res.result.heal_item_type = heal_type.clone(); - if let Some(err) = res.err.as_ref() { - res.result.detail = err.to_string(); - } - if res.result.parity_blocks > 0 - && res.result.data_blocks > 0 - && res.result.data_blocks > res.result.parity_blocks - { - let got = count_ok_drives(&res.result.after); - if got < res.result.parity_blocks { - res.result.detail = format!( - "quorum loss - expected {} minimum, got drive states in OK {}", - res.result.parity_blocks, got - ); - } - } - return self.push_heal_result_item(&res.result).await; } - None => return Ok(()), + res.result.heal_item_type = heal_type.clone(); + if let Some(err) = res.err.as_ref() { + res.result.detail = err.to_string(); + } + if res.result.parity_blocks > 0 && res.result.data_blocks > 0 && res.result.data_blocks > res.result.parity_blocks + { + let got = count_ok_drives(&res.result.after); + if got < res.result.parity_blocks { + res.result.detail = format!( + "quorum loss - expected {} minimum, got drive states in OK {}", + res.result.parity_blocks, got + ); + } + } + return self.push_heal_result_item(&res.result).await; } + None => return Ok(()), } }