limit the number of idle conns
Ted Unangst tedu@tedunangst.com
Fri, 08 Dec 2023 20:24:03 -0500
1 files changed,
10 insertions(+),
5 deletions(-)
jump to
M
activity.go
→
activity.go
@@ -59,13 +59,18 @@ }
return false } -var honkClient = http.Client{} +var honkTransport = http.Transport{ + MaxIdleConns: 120, + MaxConnsPerHost: 4, +} + +var honkClient = http.Client{ + Transport: &honkTransport, +} func gogglesDoNothing() { - honkClient.Transport = &http.Transport{ - TLSClientConfig: &tls.Config{ - InsecureSkipVerify: true, - }, + honkTransport.TLSClientConfig = &tls.Config{ + InsecureSkipVerify: true, } }