Hi there
if there is possibility to set timeout for http.Client for resources.GetRemote?
My case is to get files by http with size over 100Mb, and sometimes I got an error(when response are taken more 10seconds):
context deadline exceeded (Client.Timeout or context cancellation while reading body)
In code timeout param is hardcoded or i don’t get how it can be configured
// New creates a new Client with the given specification.
func New(rs *resources.Spec) *Client {
return &Client{
rs: rs,
httpClient: &http.Client{
Timeout: 10 * time.Second,
},
cacheGetResource: rs.FileCaches.GetResourceCache(),
}
}
1 Like
bep
November 28, 2022, 2:46pm
2
As you have pointed out, that value is currently hard coded. But the value is rather arbitrarily chosen, and I would not mind to set it to something higher (e.g. 1 minute).
3 Likes
@bep thanks, need PR or issue for this?
3 Likes
bep
November 28, 2022, 7:57pm
4
That would certainly make it happen faster.
1 Like