From 17768b5bfeb76785e943af700a70e779552a7c0b Mon Sep 17 00:00:00 2001 From: Evgeniy Kulikov Date: Fri, 14 Feb 2020 12:36:31 +0300 Subject: [PATCH] set ttl to HealthRequest --- pool.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pool.go b/pool.go index 1fdcc8d..e0c3eaa 100644 --- a/pool.go +++ b/pool.go @@ -11,6 +11,7 @@ import ( "sync" "time" + "github.com/nspcc-dev/neofs-api/service" "github.com/nspcc-dev/neofs-api/state" "github.com/spf13/viper" "go.uber.org/zap" @@ -246,7 +247,10 @@ func (p *Pool) getConnection(ctx context.Context) (*grpc.ClientConn, error) { func isAlive(ctx context.Context, log *zap.Logger, cur *grpc.ClientConn) bool { switch st := cur.GetState(); st { case connectivity.Idle, connectivity.Ready, connectivity.Connecting: - res, err := state.NewStatusClient(cur).HealthCheck(ctx, new(state.HealthRequest)) + req := new(state.HealthRequest) + req.SetTTL(service.NonForwardingTTL) + + res, err := state.NewStatusClient(cur).HealthCheck(ctx, req) if err != nil { log.Warn("could not fetch health-check", zap.Error(err))