From acd63afd48dbaf074f910cd7ee6606766a09efed Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Wed, 12 May 2021 11:04:51 +0300 Subject: [PATCH] [#493] node: Replace configuration of API clients to a separated section Replace dial timeout of API client connection from `grpc` section to `apiclient` since this value is semantically decoupled from the transport protocol. Signed-off-by: Leonard Lyubich --- cmd/neofs-node/config.go | 7 +++++-- cmd/neofs-node/object.go | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/cmd/neofs-node/config.go b/cmd/neofs-node/config.go index e97585f66..9d3a64562 100644 --- a/cmd/neofs-node/config.go +++ b/cmd/neofs-node/config.go @@ -68,7 +68,9 @@ const ( // config keys for cfgGRPC cfgListenAddress = "grpc.endpoint" - cfgDialTimeout = "grpc.dial_timeout" + + // config keys for API client cache + cfgAPIClientDialTimeout = "apiclient.dial_timeout" // config keys for cfgMorph cfgMorphRPCAddress = "morph.rpc_endpoint" @@ -465,7 +467,8 @@ func defaultConfiguration(v *viper.Viper) { v.SetDefault(cfgMorphNotifyDialTimeout, 5*time.Second) v.SetDefault(cfgListenAddress, "127.0.0.1:50501") // listen address - v.SetDefault(cfgDialTimeout, 5*time.Second) + + v.SetDefault(cfgAPIClientDialTimeout, 5*time.Second) v.SetDefault(cfgAccountingContract, "1aeefe1d0dfade49740fff779c02cd4a0538ffb1") v.SetDefault(cfgAccountingFee, "1") diff --git a/cmd/neofs-node/object.go b/cmd/neofs-node/object.go index b49f11689..c875b789a 100644 --- a/cmd/neofs-node/object.go +++ b/cmd/neofs-node/object.go @@ -168,7 +168,7 @@ func initObjectService(c *cfg) { nodeOwner.SetNeo3Wallet(neo3Wallet) clientCache := cache.NewSDKClientCache( - client.WithDialTimeout(c.viper.GetDuration(cfgDialTimeout))) + client.WithDialTimeout(c.viper.GetDuration(cfgAPIClientDialTimeout))) clientConstructor := &reputationClientConstructor{ log: c.log,