Skip to content

Commit

Permalink
always bar.Wait() on retry false
Browse files Browse the repository at this point in the history
bar is defer canceled at errgroup.Group level, so need to wait.
  • Loading branch information
vbauerster committed Jul 27, 2024
1 parent 68b94b4 commit e3b0b28
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions part.go
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,7 @@ func (p *Part) download(

if p.isDone() {
if err == io.EOF || err == io.ErrUnexpectedEOF {
bar.Wait()
return false, fpart.Sync()
}
return false, errors.Wrap(err, "Expected one of EOF")
Expand All @@ -339,7 +340,10 @@ func (p *Part) download(
// err is never nil here
return true, err
}

p.logger.Println("Stopping: session must be not resumable:", err.Error())
bar.EnableTriggerComplete()
bar.Wait()
return false, nil
})
}
Expand Down

0 comments on commit e3b0b28

Please sign in to comment.