From 257ffeb99747a2bb9caed54b1d51020aca95b0ae Mon Sep 17 00:00:00 2001 From: Michael Yang Date: Thu, 12 Oct 2023 12:52:35 -0700 Subject: [PATCH] fix download --- server/download.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/download.go b/server/download.go index 0c3beb7e..acfa8e52 100644 --- a/server/download.go +++ b/server/download.go @@ -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