mirror of
https://github.com/YGGverse/aquatic-crawler.git
synced 2026-04-02 18:15:31 +00:00
do not skip errors
This commit is contained in:
parent
ecdfe2d134
commit
b07d6940e1
1 changed files with 2 additions and 4 deletions
|
|
@ -56,10 +56,8 @@ impl Storage {
|
||||||
/// Recursively remove all files under the `infohash` location
|
/// Recursively remove all files under the `infohash` location
|
||||||
/// that do not match the `skip_filename` (see rqbit#408)
|
/// that do not match the `skip_filename` (see rqbit#408)
|
||||||
pub fn cleanup(&self, infohash: &str, skip_filename: Option<®ex::Regex>) -> Result<()> {
|
pub fn cleanup(&self, infohash: &str, skip_filename: Option<®ex::Regex>) -> Result<()> {
|
||||||
for e in walkdir::WalkDir::new(self.output_folder(infohash, false)?)
|
for e in walkdir::WalkDir::new(self.output_folder(infohash, false)?) {
|
||||||
.into_iter()
|
let e = e?;
|
||||||
.filter_map(Result::ok)
|
|
||||||
{
|
|
||||||
let p = e.path();
|
let p = e.path();
|
||||||
if p.is_file() && skip_filename.is_none_or(|r| !r.is_match(p.to_str().unwrap())) {
|
if p.is_file() && skip_filename.is_none_or(|r| !r.is_match(p.to_str().unwrap())) {
|
||||||
fs::remove_file(p)?;
|
fs::remove_file(p)?;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue