Compare commits
1 Commits
ef024cc8a8
...
094b0b7412
Author | SHA1 | Date | |
---|---|---|---|
094b0b7412 |
@ -187,11 +187,11 @@ async fn download_file(
|
|||||||
let mut written = 0;
|
let mut written = 0;
|
||||||
while let Some(img_chunk) = res.chunk().await.unwrap() {
|
while let Some(img_chunk) = res.chunk().await.unwrap() {
|
||||||
if !running.load(Ordering::SeqCst) {
|
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);
|
drop(file);
|
||||||
std::fs::remove_file(&file_path).unwrap();
|
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;
|
return;
|
||||||
}
|
}
|
||||||
file.write_all(&img_chunk).unwrap();
|
file.write_all(&img_chunk).unwrap();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user