Skip unrar extract errors, update compress-tools

This commit is contained in:
Tyler Hallada
2021-08-09 11:10:57 -06:00
parent 6136ac18fa
commit db2e73aa8e
3 changed files with 21 additions and 8 deletions

View File

@@ -153,10 +153,23 @@ async fn extract_with_unrar(
info!("uncompressing downloaded archive");
let extract = Archive::new(&temp_file_path.to_string_lossy().to_string())?
.extract_to(temp_dir.path().to_string_lossy().to_string());
extract
.expect("failed to extract")
.process()
.expect("failed to extract");
let mut extract = match extract {
Err(err) => {
warn!(error = %err, "failed to extract with unrar");
file::update_unable_to_extract_plugins(&pool, db_file.id, true).await?;
return Ok(())
}
Ok(extract) => extract
};
match extract.process() {
Err(err) => {
warn!(error = %err, "failed to extract with unrar");
file::update_unable_to_extract_plugins(&pool, db_file.id, true).await?;
return Ok(())
}
_ => {}
}
for file_path in plugin_file_paths.iter() {
info!(