Merge pull request #11886 from hakman/download_3_min

Set download timeout to 3 minutes
This commit is contained in:
Kubernetes Prow Robot 2021-06-29 08:10:41 -07:00 committed by GitHub
commit c47ff10d41
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -93,9 +93,9 @@ func downloadURLAlways(url string, destPath string, dirMode os.FileMode) error {
},
}
// this will stop slow downloads after 5 minutes
// this will stop slow downloads after 3 minutes
// and interrupt reading of the Response.Body
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute)
ctx, cancel := context.WithTimeout(context.Background(), 3*time.Minute)
defer cancel()
req, err := http.NewRequestWithContext(ctx, http.MethodGet, url, nil)