Skip to content

Commit e0734b2

Browse files
authored
Update utils.go
1 parent 019ad0c commit e0734b2

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

dev-tools/mage/downloads/utils.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ func downloadFile(downloadRequest *downloadRequest) error {
3232
retryCount := 1
3333
var fileReader io.ReadCloser
3434
download := func() error {
35-
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
35+
ctx, cancel := context.WithTimeout(context.Background(), time.Minute)
3636
defer cancel()
3737
req, err := http.NewRequestWithContext(ctx, http.MethodGet, downloadRequest.URL, nil)
3838
if err != nil {
@@ -43,7 +43,7 @@ func downloadFile(downloadRequest *downloadRequest) error {
4343
req.Header.Add("If-Modified-Since", stat.ModTime().Format(http.TimeFormat))
4444
}
4545

46-
resp, err := http.DefaultClient.Do(req) //nolint:bodycloser
46+
resp, err := http.DefaultClient.Do(req) //nolint:bodyclose // we do close this outside of the function
4747
if err != nil {
4848
retryCount++
4949
return fmt.Errorf("downloading file %s: %w", downloadRequest.URL, err)

0 commit comments

Comments
 (0)