return on part done
This commit is contained in:
parent
7ca71a6b0f
commit
ac145f75ca
1 changed files with 1 additions and 1 deletions
|
@ -221,7 +221,7 @@ func (b *blobDownload) downloadChunk(ctx context.Context, requestURL *url.URL, w
|
|||
}
|
||||
defer resp.Body.Close()
|
||||
|
||||
n, err := io.Copy(w, io.TeeReader(resp.Body, part))
|
||||
n, err := io.CopyN(w, io.TeeReader(resp.Body, part), part.Size)
|
||||
if err != nil && !errors.Is(err, context.Canceled) && !errors.Is(err, io.ErrUnexpectedEOF) {
|
||||
// rollback progress
|
||||
b.Completed.Add(-n)
|
||||
|
|
Loading…
Reference in a new issue