Skip to content

Commit dae7d75

Browse files
fix: remove file if download failed
1 parent ffd4d18 commit dae7d75

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/main.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,7 @@ impl Handler {
384384
let task = &mut tasklist[i_task];
385385
task.status = DownloadStatus::Failed;
386386
task.data = e.to_string();
387+
fs::remove_file(&current_task.dest);
387388
post_callback(&tasklist, "failed");
388389
return;
389390
}

0 commit comments

Comments
 (0)