mirror of
https://codeberg.org/Codeberg/pages-server.git
synced 2025-04-24 22:06:57 +00:00
17 lines
375 B
Go
17 lines
375 B
Go
|
package shared
|
||
|
|
||
|
import (
|
||
|
"time"
|
||
|
|
||
|
"github.com/valyala/fasthttp"
|
||
|
)
|
||
|
|
||
|
func GetFastHTTPClient(timeout time.Duration) *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!
|
||
|
}
|
||
|
}
|