[#1031] morph: Add maxConnPerHost option

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
Pavel Karpy 2021-12-15 21:04:36 +03:00 committed by Alex Vanin
parent 63e035bd8a
commit c49e53ba9d
3 changed files with 18 additions and 3 deletions

View file

@ -25,7 +25,8 @@ type multiClient struct {
// note: must be wrapped into mutex lock.
func (x *multiClient) createForAddress(addr string) (*Client, error) {
cli, err := client.New(x.cfg.ctx, addr, client.Options{
DialTimeout: x.cfg.dialTimeout,
DialTimeout: x.cfg.dialTimeout,
MaxConnsPerHost: x.cfg.maxConnPerHost,
})
if err != nil {
return nil, err