[#1446] services/tree: Cache connections to the container nodes

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
Evgenii Stratonikov 2022-05-28 12:27:55 +03:00 committed by fyrchik
parent 4437cd7113
commit b04f712773
4 changed files with 69 additions and 18 deletions

View file

@ -70,7 +70,7 @@ func (s *Service) replicate(ctx context.Context, op movePair) error {
n.IterateNetworkEndpoints(func(addr string) bool {
lastAddr = addr
c, err := dialTreeService(ctx, addr)
c, err := s.cache.get(ctx, addr)
if err != nil {
lastErr = err
return false