[#1031] adm: Use `10` as `maxConnPerHost` in `neo-go` client
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>remotes/fyrchik/prometheus-epoch
parent
c49e53ba9d
commit
11466ea3cc
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue