Compare commits
1 Commits
094b0b7412
...
ef024cc8a8
Author | SHA1 | Date | |
---|---|---|---|
ef024cc8a8 |
@ -187,11 +187,11 @@ async fn download_file(
|
||||
let mut written = 0;
|
||||
while let Some(img_chunk) = res.chunk().await.unwrap() {
|
||||
if !running.load(Ordering::SeqCst) {
|
||||
this_bar.abandon_with_message(format!(
|
||||
"\x1b[37m[{i: >4}/{urls_amount}] \x1b[33mcancelling {img_url}\x1b[0m"
|
||||
));
|
||||
drop(file);
|
||||
std::fs::remove_file(&file_path).unwrap();
|
||||
this_bar.finish_with_message(format!(
|
||||
"\x1b[37m[{i: >4}/{urls_amount}] \x1b[33mcancelled {img_url}\x1b[0m"
|
||||
));
|
||||
return;
|
||||
}
|
||||
file.write_all(&img_chunk).unwrap();
|
||||
|
Loading…
x
Reference in New Issue
Block a user