mirror of
https://github.com/lukaszraczylo/graphql-monitoring-proxy.git
synced 2026-10-14 05:48:25 +00:00
Adjust the timeout settings to prevent forever-hanging connections.
This commit is contained in:
@@ -18,8 +18,13 @@ func createFasthttpClient(timeout int) *fasthttp.Client {
|
||||
TLSConfig: &tls.Config{
|
||||
InsecureSkipVerify: true,
|
||||
},
|
||||
MaxConnsPerHost: 100,
|
||||
MaxIdleConnDuration: time.Duration(timeout*5) * time.Minute,
|
||||
MaxConnsPerHost: 100,
|
||||
MaxIdleConnDuration: func() time.Duration {
|
||||
if timeout%2 != 0 {
|
||||
timeout++
|
||||
}
|
||||
return time.Duration(timeout/2) * time.Second
|
||||
}(),
|
||||
ReadTimeout: time.Second * time.Duration(timeout),
|
||||
WriteTimeout: time.Second * time.Duration(timeout),
|
||||
DisableHeaderNamesNormalizing: true,
|
||||
|
||||
Reference in New Issue
Block a user