diff --git a/server/gitea/client_fasthttp.go b/server/gitea/client_fasthttp.go index 5f95ba4..7f6f0dc 100644 --- a/server/gitea/client_fasthttp.go +++ b/server/gitea/client_fasthttp.go @@ -113,3 +113,11 @@ func joinURL(baseURL string, paths ...string) string { return baseURL + "/" + strings.Join(p, "/") } + +func getFastHTTPClient() *fasthttp.Client { + return &fasthttp.Client{ + MaxConnDuration: 60 * time.Second, + MaxConnWaitTimeout: 1000 * time.Millisecond, + MaxConnsPerHost: 128 * 16, // TODO: adjust bottlenecks for best performance with Gitea! + } +} diff --git a/server/gitea/client_fasthttp_test.go b/server/gitea/client_fasthttp_test.go index 7dbad68..f92a450 100644 --- a/server/gitea/client_fasthttp_test.go +++ b/server/gitea/client_fasthttp_test.go @@ -1,3 +1,5 @@ +//go:build fasthttp + package gitea import ( diff --git a/server/gitea/fasthttp.go b/server/gitea/fasthttp.go deleted file mode 100644 index 4ff0f4a..0000000 --- a/server/gitea/fasthttp.go +++ /dev/null @@ -1,15 +0,0 @@ -package gitea - -import ( - "time" - - "github.com/valyala/fasthttp" -) - -func getFastHTTPClient() *fasthttp.Client { - return &fasthttp.Client{ - MaxConnDuration: 60 * time.Second, - MaxConnWaitTimeout: 1000 * time.Millisecond, - MaxConnsPerHost: 128 * 16, // TODO: adjust bottlenecks for best performance with Gitea! - } -}