Unverified Commit 7a537cdc authored by Michael Yang's avatar Michael Yang Committed by GitHub
Browse files

Merge pull request #770 from jmorganca/mxyng/fix-download

fix download
parents 9b513bb6 257ffeb9
......@@ -144,7 +144,7 @@ func (b *blobDownload) run(ctx context.Context, requestURL *url.URL, opts *Regis
file.Truncate(b.Total)
g, _ := errgroup.WithContext(ctx)
g, inner := errgroup.WithContext(ctx)
g.SetLimit(numDownloadParts)
for i := range b.Parts {
part := b.Parts[i]
......@@ -156,7 +156,7 @@ func (b *blobDownload) run(ctx context.Context, requestURL *url.URL, opts *Regis
g.Go(func() error {
for try := 0; try < maxRetries; try++ {
w := io.NewOffsetWriter(file, part.StartsAt())
err := b.downloadChunk(ctx, requestURL, w, part, opts)
err := b.downloadChunk(inner, requestURL, w, part, opts)
switch {
case errors.Is(err, context.Canceled):
return err
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment