mirror of
https://github.com/mimblewimble/grin.git
synced 2025-01-20 19:11:08 +03:00
suppress the debug log for unexpected file report (#2574)
* supress the debug log for unexpected file report in check_and_remove_files * revise according to review comments * rustfmt
This commit is contained in:
parent
99494c6fa6
commit
271042c3b0
1 changed files with 18 additions and 10 deletions
|
@ -1496,19 +1496,27 @@ fn check_and_remove_files(txhashset_path: &PathBuf, header: &BlockHeader) -> Res
|
|||
.difference(&pmmr_files_expected)
|
||||
.cloned()
|
||||
.collect();
|
||||
let mut removed = 0;
|
||||
if !difference.is_empty() {
|
||||
debug!(
|
||||
"Unexpected file(s) found in txhashset subfolder {:?}, removing.",
|
||||
&subdirectory_path
|
||||
);
|
||||
for diff in difference {
|
||||
for diff in &difference {
|
||||
let diff_path = subdirectory_path.join(diff);
|
||||
file::delete(diff_path.clone())?;
|
||||
debug!(
|
||||
"check_and_remove_files: unexpected file '{:?}' removed",
|
||||
diff_path
|
||||
);
|
||||
match file::delete(diff_path.clone()) {
|
||||
Err(e) => error!(
|
||||
"check_and_remove_files: fail to remove file '{:?}', Err: {:?}",
|
||||
diff_path, e,
|
||||
),
|
||||
Ok(_) => {
|
||||
removed += 1;
|
||||
trace!("check_and_remove_files: file '{:?}' removed", diff_path);
|
||||
}
|
||||
}
|
||||
}
|
||||
debug!(
|
||||
"{} tmp file(s) found in txhashset subfolder {:?}, {} removed.",
|
||||
difference.len(),
|
||||
&subdirectory_path,
|
||||
removed,
|
||||
);
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
|
|
Loading…
Reference in a new issue