Close ticker

This commit is contained in:
Xpl0itU 2024-04-14 00:08:33 +02:00
parent d07e0e7fea
commit 0e58e069cb
2 changed files with 7 additions and 0 deletions

View file

@ -82,6 +82,7 @@ func downloadFileWithSemaphore(ctx context.Context, progressReporter ProgressRep
if err != nil {
file.Close()
resp.Body.Close()
writerProgress.Close()
if doRetries && attempt < maxRetries && !progressReporter.Cancelled() {
time.Sleep(retryDelay)
continue
@ -90,6 +91,7 @@ func downloadFileWithSemaphore(ctx context.Context, progressReporter ProgressRep
}
file.Close()
resp.Body.Close()
writerProgress.Close()
break
}