handle checking for file better
This commit is contained in:
@@ -52,7 +52,10 @@ pub async fn check_file_length(file: &PathBuf) -> Option<u64> {
|
||||
}
|
||||
},
|
||||
Err(err) => {
|
||||
error!("Failed to open file for testing... {:?} {}", file, err);
|
||||
match err.kind() {
|
||||
ErrorKind::NotFound => {/* ignore */},
|
||||
_ => warn!("Failed to open file to check length. {:?} {}", file, err),
|
||||
}
|
||||
},
|
||||
}
|
||||
None
|
||||
|
@@ -246,6 +246,9 @@ async fn process(mut site: Website, db: Surreal<Client>, reqwest: reqwest::Clien
|
||||
if disk_len == len {
|
||||
skip_download = true;
|
||||
}
|
||||
} else {
|
||||
// File not found (or other error).
|
||||
// Program will continue on it's way, downloading content.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user