mirror of
https://github.com/Xpl0itU/WiiUDownloader.git
synced 2025-05-30 23:15:18 -04:00
Close ticker
This commit is contained in:
parent
d07e0e7fea
commit
0e58e069cb
2 changed files with 7 additions and 0 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
@ -33,3 +33,8 @@ func (r *WriterProgress) Write(p []byte) (n int, err error) {
|
|||
r.downloadToReport += int64(n)
|
||||
return n, err
|
||||
}
|
||||
|
||||
func (r *WriterProgress) Close() error {
|
||||
r.updateProgressTicker.Stop()
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue