Skip to content

Commit

Permalink
init sleepCtx with empty context
Browse files Browse the repository at this point in the history
  • Loading branch information
vbauerster committed Mar 13, 2024
1 parent 2d2c484 commit 5766fa3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion part.go
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ func (p *Part) download(client *http.Client, req *http.Request, timeout, sleep t
defer resp.Body.Close()

buf := make([]byte, bufSize)
sleepCtx, sleepCancel := context.WithCancel(p.ctx)
sleepCtx, sleepCancel := context.WithCancel(context.Background())
sleepCancel()
for n := 0; err == nil; sleepCancel() {
timer.Reset(timeout)
Expand Down

0 comments on commit 5766fa3

Please sign in to comment.