forked from TrueCloudLab/frostfs-node
[#422] pkg/services: Provide client options on cache creation
Because options are not used when client is already in cache providing them to shared cache is misleading at best. In the worst case `dial_timeout` is set randomly (because of race condition) which can lead to one service having `dial_timeout` of another. Thus we set default client creation options when cache is created. Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
parent
cc7287d6f7
commit
6679d59e89
13 changed files with 22 additions and 79 deletions
|
@ -23,8 +23,6 @@ type uniqueIDWriter struct {
|
|||
|
||||
type clientCacheWrapper struct {
|
||||
cache *cache.ClientCache
|
||||
|
||||
opts []client.Option
|
||||
}
|
||||
|
||||
type clientWrapper struct {
|
||||
|
@ -71,7 +69,7 @@ func (w *uniqueIDWriter) WriteIDs(list []*objectSDK.ID) error {
|
|||
}
|
||||
|
||||
func (c *clientCacheWrapper) get(addr string) (searchClient, error) {
|
||||
clt, err := c.cache.Get(addr, c.opts...)
|
||||
clt, err := c.cache.Get(addr)
|
||||
|
||||
return &clientWrapper{
|
||||
client: clt,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue