Use async delete to save time and gracefully handle missing dir (#31380)
This commit is contained in:
parent
6f014710ff
commit
a52f44c342
|
@ -1229,7 +1229,7 @@ pub fn add_bank_snapshot(
|
||||||
.join(&slot_str);
|
.join(&slot_str);
|
||||||
if account_snapshot_path.is_dir() {
|
if account_snapshot_path.is_dir() {
|
||||||
// remove the account snapshot directory
|
// remove the account snapshot directory
|
||||||
fs::remove_dir_all(&account_snapshot_path)?;
|
move_and_async_delete_path(&account_snapshot_path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1354,7 +1354,7 @@ where
|
||||||
// They should all be removed.
|
// They should all be removed.
|
||||||
for entry in fs::read_dir(accounts_hardlinks_dir)? {
|
for entry in fs::read_dir(accounts_hardlinks_dir)? {
|
||||||
let dst_path = fs::read_link(entry?.path())?;
|
let dst_path = fs::read_link(entry?.path())?;
|
||||||
fs::remove_dir_all(dst_path)?;
|
move_and_async_delete_path(&dst_path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fs::remove_dir_all(bank_snapshot_dir)?;
|
fs::remove_dir_all(bank_snapshot_dir)?;
|
||||||
|
|
Loading…
Reference in New Issue