create fastClient once

This commit is contained in:
6543 2022-06-11 22:46:38 +02:00
parent 8add62ee2f
commit 4e42bca189
2 changed files with 4 additions and 3 deletions

View file

@ -6,9 +6,8 @@ import (
"github.com/valyala/fasthttp"
)
func getFastHTTPClient(timeout time.Duration) *fasthttp.Client {
func getFastHTTPClient() *fasthttp.Client {
return &fasthttp.Client{
ReadTimeout: timeout,
MaxConnDuration: 60 * time.Second,
MaxConnWaitTimeout: 1000 * time.Millisecond,
MaxConnsPerHost: 128 * 16, // TODO: adjust bottlenecks for best performance with Gitea!