Skip to content
This repository was archived by the owner on Jan 22, 2025. It is now read-only.

Replaces fs-err in remove_tmp_snapshot_archives() #34839

Merged
merged 1 commit into from
Jan 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions runtime/src/snapshot_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ use {
std::{
cmp::Ordering,
collections::{HashMap, HashSet},
fmt,
fmt, fs,
io::{BufReader, BufWriter, Error as IoError, ErrorKind, Read, Seek, Write},
num::NonZeroUsize,
path::{Path, PathBuf},
Expand Down Expand Up @@ -641,12 +641,15 @@ pub fn remove_tmp_snapshot_archives(snapshot_archives_dir: impl AsRef<Path>) {
{
let path = entry.path();
let result = if path.is_dir() {
fs_err::remove_dir_all(path)
fs::remove_dir_all(&path)
} else {
fs_err::remove_file(path)
fs::remove_file(&path)
};
if let Err(err) = result {
warn!("Failed to remove temporary snapshot archive: {err}");
warn!(
"Failed to remove temporary snapshot archive '{}': {err}",
path.display(),
);
}
}
}
Expand Down