[#1031] adm: Use `10` as `maxConnPerHost` in `neo-go` client

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
remotes/fyrchik/prometheus-epoch
Pavel Karpy 2021-12-15 21:05:21 +03:00 committed by Alex Vanin
parent c49e53ba9d
commit 11466ea3cc
1 changed files with 5 additions and 1 deletions

View File

@ -20,12 +20,16 @@ type clientContext struct {
}
func getN3Client(v *viper.Viper) (*client.Client, error) {
// number of opened connections
// by neo-go client per one host
const maxConnsPerHost = 10
ctx := context.Background() // FIXME(@fyrchik): timeout context
endpoint := v.GetString(endpointFlag)
if endpoint == "" {
return nil, errors.New("missing endpoint")
}
c, err := client.New(ctx, endpoint, client.Options{})
c, err := client.New(ctx, endpoint, client.Options{MaxConnsPerHost: maxConnsPerHost})
if err != nil {
return nil, err
}