GODT-1348: max 100 conn per host

This commit is contained in:
James Houlahan
2021-09-14 14:57:02 +02:00
committed by Jakub
parent 8f1ca00c9d
commit cd6b5cdcc3
3 changed files with 15 additions and 4 deletions

View File

@ -43,7 +43,7 @@ func New(cfg Config) Manager {
func newManager(cfg Config) *manager {
m := &manager{
cfg: cfg,
rc: resty.New(),
rc: resty.New().EnableTrace(),
locker: &sync.Mutex{},
}
@ -59,6 +59,7 @@ func newManager(cfg Config) *manager {
// wrapped in JSON. If error is returned, `handleRequestFailure` is called,
// otherwise `handleRequestSuccess` is called.
m.rc.SetError(&Error{})
m.rc.OnAfterResponse(logConnReuse)
m.rc.OnAfterResponse(updateTime)
m.rc.OnAfterResponse(m.catchAPIError)
m.rc.OnAfterResponse(m.handleRequestSuccess)