Skip to content

Commit

Permalink
release lock faster
Browse files Browse the repository at this point in the history
  • Loading branch information
mcdallas committed Nov 10, 2022
1 parent 7744523 commit 3162a64
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/download.rs
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ impl<'a> Downloader<'a> {
let parsed = match response.json::<StreamableApiResponse>().await {
Ok(j) => j,
Err(e) => {
self.fail(&format!("Error parsing streamable API response: {}", e));
self.fail(&format!("Error parsing streamable API response from {}: {}", streamable_url, e));
return;
}
};
Expand Down Expand Up @@ -563,7 +563,11 @@ impl<'a> Downloader<'a> {
let result = self.download_media(&file_name, &task.url).await;
match result {
Ok(true) => {
*self.downloaded.lock().unwrap() += 1;

{
*self.downloaded.lock().unwrap() += 1;
}

match self.post_process(file_name, &task).await {
Ok(filepath) => Some(filepath),
Err(e) => {
Expand Down

0 comments on commit 3162a64

Please sign in to comment.