forked from TrueCloudLab/frostfs-node
[#1031] adm: Use 10
as maxConnPerHost
in neo-go
client
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
parent
c49e53ba9d
commit
11466ea3cc
1 changed files with 5 additions and 1 deletions
|
@ -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 a new issue