Compare commits

..
Author SHA1 Message Date
Majd Alfhaily 2f154ad4f9 Disable timeout for downloading files (#123) 2022-12-07 17:46:07 +00:00
2 changed files with 7 additions and 1 deletions

No files matched your search

+6
View File
@@ -174,6 +174,12 @@ func (a *appstore) downloadFile(dst, sourceURL string) (err error) {
return errors.Wrap(err, ErrOpenFile.Error())
}
defer func() {
if closeErr := file.Close(); closeErr != err && err == nil {
err = closeErr
}
}()
sizeMB := float64(res.ContentLength) / (1 << 20)
a.logger.Verbose().Str("size", fmt.Sprintf("%.2fMB", sizeMB)).Msg("downloading")
+1 -1
View File
@@ -78,7 +78,7 @@ func (c *client[R]) Send(req Request) (Result[R], error) {
}
func (c *client[R]) Do(req *http.Request) (*http.Response, error) {
return c.internalClient.Do(req)
return http.DefaultClient.Do(req)
}
func (*client[R]) NewRequest(method, url string, body io.Reader) (*http.Request, error) {