Skip to content

Commit

Permalink
add back part.Reset()
Browse files Browse the repository at this point in the history
  • Loading branch information
jmorganca committed Nov 19, 2023
1 parent 72cd336 commit 9d73d3a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions server/upload.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ func (b *blobUpload) Run(ctx context.Context, opts *RegistryOptions) {
case errors.Is(err, errMaxRetriesExceeded):
return err
case err != nil:
part.Reset()
sleep := time.Second * time.Duration(math.Pow(2, float64(try)))
log.Printf("%s part %d attempt %d failed: %v, retrying in %s", b.Digest[7:19], part.N, try, err, sleep)
time.Sleep(sleep)
Expand Down Expand Up @@ -258,6 +259,7 @@ func (b *blobUpload) uploadChunk(ctx context.Context, method string, requestURL
case errors.Is(err, errMaxRetriesExceeded):
return err
case err != nil:
part.Reset()
sleep := time.Second * time.Duration(math.Pow(2, float64(try)))
log.Printf("%s part %d attempt %d failed: %v, retrying in %s", b.Digest[7:19], part.N, try, err, sleep)
time.Sleep(sleep)
Expand Down

0 comments on commit 9d73d3a

Please sign in to comment.