Skip to content

Commit

Permalink
rm fastClient
Browse files Browse the repository at this point in the history
  • Loading branch information
Hitenjain14 committed Feb 1, 2024
1 parent 0419d35 commit 731047b
Showing 1 changed file with 4 additions and 17 deletions.
21 changes: 4 additions & 17 deletions zboxcore/zboxutil/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,10 @@ type HttpClient interface {
}

var (
Client HttpClient
FastHttpClient *fasthttp.Client
HostClientMap = make(map[string]*fasthttp.HostClient)
hostLock sync.RWMutex
log logger.Logger
Client HttpClient
HostClientMap = make(map[string]*fasthttp.HostClient)
hostLock sync.RWMutex
log logger.Logger
)

func GetLogger() *logger.Logger {
Expand Down Expand Up @@ -173,18 +172,6 @@ func init() {
Client = &http.Client{
Transport: DefaultTransport,
}
maxIdleConnDuration, _ := time.ParseDuration("1h")
FastHttpClient = &fasthttp.Client{
MaxIdleConnDuration: maxIdleConnDuration,
NoDefaultUserAgentHeader: true, // Don't send: User-Agent: fasthttp
DisableHeaderNamesNormalizing: true, // If you set the case on your headers correctly you can enable this
DisablePathNormalizing: true,
// increase DNS cache time to an hour instead of default minute
Dial: (&fasthttp.TCPDialer{
Concurrency: 4096,
DNSCacheDuration: time.Hour,
}).Dial,
}
envProxy.initialize()
log.Init(logger.DEBUG, "0box-sdk")
}
Expand Down

0 comments on commit 731047b

Please sign in to comment.