setup timeouts on reddit http client

This commit is contained in:
Andre Medeiros 2022-07-15 12:34:28 -04:00
parent 547ab64c20
commit 102cbb2ee2

View file

@ -88,17 +88,10 @@ func NewClient(id, secret string, statsd statsd.ClientInterface, redis *redis.Cl
},
}
/*
t := http.DefaultTransport.(*http.Transport).Clone()
t.MaxIdleConns = connLimit / 4 / 100
t.MaxConnsPerHost = connLimit / 100
t.MaxIdleConnsPerHost = connLimit / 4 / 100
t.IdleConnTimeout = 60 * time.Second
t.ResponseHeaderTimeout = 5 * time.Second
client := &http.Client{Transport: t}
*/
client := &http.Client{}
t := http.DefaultTransport.(*http.Transport).Clone()
t.IdleConnTimeout = 60 * time.Second
t.ResponseHeaderTimeout = 5 * time.Second
client := &http.Client{Transport: t}
pool := &fastjson.ParserPool{}