Skip to content
Snippets Groups Projects
Commit 0d66f2c6 authored by Frédéric Guillot's avatar Frédéric Guillot
Browse files

Tweak default HTTP client transport timeout values

Reducing these values avoid going over the max number of file descriptors when refreshing lot of feeds
parent 6d25fb71
No related branches found
No related tags found
No related merge requests found
...@@ -237,7 +237,22 @@ func (c *Client) buildRequest(method string, body io.Reader) (*http.Request, err ...@@ -237,7 +237,22 @@ func (c *Client) buildRequest(method string, body io.Reader) (*http.Request, err
func (c *Client) buildClient() http.Client { func (c *Client) buildClient() http.Client {
client := http.Client{Timeout: time.Duration(config.Opts.HTTPClientTimeout()) * time.Second} client := http.Client{Timeout: time.Duration(config.Opts.HTTPClientTimeout()) * time.Second}
transport := &http.Transport{} transport := &http.Transport{
DialContext: (&net.Dialer{
// Default is 30s.
Timeout: 10 * time.Second,
// Default is 30s.
KeepAlive: 15 * time.Second,
}).DialContext,
// Default is 100.
MaxIdleConns: 50,
// Default is 90s.
IdleConnTimeout: 10 * time.Second,
}
if c.Insecure { if c.Insecure {
transport.TLSClientConfig = &tls.Config{InsecureSkipVerify: true} transport.TLSClientConfig = &tls.Config{InsecureSkipVerify: true}
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment