Signed-off-by: mujunxiang <1948535941@qq.com>
This commit is contained in:
mujunxiang
2024-11-19 17:30:50 +08:00
parent e94d462652
commit ec8b73bd9c
2 changed files with 33 additions and 35 deletions
+4 -2
View File
@@ -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);
+1 -5
View File
@@ -326,7 +326,6 @@ impl HealSequence {
count
};
loop {
match resp_rx.recv().await {
Some(mut res) => {
if res.err.is_none() {
@@ -348,9 +347,7 @@ impl HealSequence {
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
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 {
@@ -365,7 +362,6 @@ impl HealSequence {
None => return Ok(()),
}
}
}
async fn heal_disk_meta(h: Arc<RwLock<HealSequence>>) -> Result<()> {
HealSequence::heal_rustfs_sys_meta(h, CONFIG_PREFIX).await