mirror of
https://github.com/mimblewimble/grin.git
synced 2025-02-01 17:01:09 +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,21 +1496,29 @@ fn check_and_remove_files(txhashset_path: &PathBuf, header: &BlockHeader) -> Res
|
||||||
.difference(&pmmr_files_expected)
|
.difference(&pmmr_files_expected)
|
||||||
.cloned()
|
.cloned()
|
||||||
.collect();
|
.collect();
|
||||||
|
let mut removed = 0;
|
||||||
if !difference.is_empty() {
|
if !difference.is_empty() {
|
||||||
debug!(
|
for diff in &difference {
|
||||||
"Unexpected file(s) found in txhashset subfolder {:?}, removing.",
|
|
||||||
&subdirectory_path
|
|
||||||
);
|
|
||||||
for diff in difference {
|
|
||||||
let diff_path = subdirectory_path.join(diff);
|
let diff_path = subdirectory_path.join(diff);
|
||||||
file::delete(diff_path.clone())?;
|
match file::delete(diff_path.clone()) {
|
||||||
debug!(
|
Err(e) => error!(
|
||||||
"check_and_remove_files: unexpected file '{:?}' removed",
|
"check_and_remove_files: fail to remove file '{:?}', Err: {:?}",
|
||||||
diff_path
|
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(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue