1
0
Fork 0
mirror of https://github.com/anyproto/any-sync.git synced 2025-06-09 09:35:03 +09:00

Add err messages to ns/pp clients

This commit is contained in:
Anthony Akentiev 2024-08-27 10:02:25 +01:00
parent df91cb945a
commit a0493af22f
No known key found for this signature in database
GPG key ID: 017A11DC01A79831
2 changed files with 9 additions and 2 deletions

View file

@ -77,14 +77,16 @@ func (s *service) doClient(ctx context.Context, fn func(cl nsp.DRPCAnynsClient)
// it will try to connect to the Naming Node
// please enable "namingNode" type of node in the config (in the network.nodes array)
peer, err := s.pool.GetOneOf(ctx, s.nodeconf.NamingNodePeers())
log.Info("trying to connect to namingNode peer: ", zap.Any("peer", peer))
if err != nil {
log.Error("failed to get a namingnode peer. maybe you're on a custom network", zap.Error(err))
return err
}
log.Debug("trying to connect to namingNode peer: ", zap.Any("peer", peer))
dc, err := peer.AcquireDrpcConn(ctx)
if err != nil {
log.Error("failed to acquire a DRPC connection to namingnode", zap.Error(err))
return err
}
defer peer.ReleaseDrpcConn(dc)