Skip to content

Commit fa72d1b

Browse files
chore(librarian): Windows/local improvements when fetching repos. (#3567)
- When fetching repos locally 60s is not enough time. - We need to close the temp file containing the downloaded repo before renaming it etc.
1 parent 2723d08 commit fa72d1b

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

internal/fetch/fetch.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,8 @@ func DownloadTarball(ctx context.Context, target, url, expectedSha256 string) er
172172
return err
173173
}
174174
tempPath := tempFile.Name()
175+
_ = tempFile.Close()
175176
defer func() {
176-
tempFile.Close()
177177
cerr := os.Remove(tempPath)
178178
if err == nil && cerr != nil && !os.IsNotExist(cerr) {
179179
err = cerr
@@ -233,7 +233,7 @@ func downloadAttempt(ctx context.Context, target, source string) (err error) {
233233
}
234234
}()
235235

236-
client := http.Client{Timeout: 60 * time.Second}
236+
client := http.Client{Timeout: 5 * time.Minute}
237237
req, err := http.NewRequestWithContext(ctx, http.MethodGet, source, nil)
238238
if err != nil {
239239
return err

0 commit comments

Comments
 (0)