From 4c310ae1c7fa0a5d95ea941e18d0dcf56fc95a08 Mon Sep 17 00:00:00 2001 From: Dmitrii Stepanov Date: Mon, 7 Oct 2024 16:54:54 +0300 Subject: [PATCH] [#280] client: Use `DialTimeout` for gRPC dial After removing `grpc.Dial` from client `DialTimeout` used only if custom dialer provided. Client uses `BalanceOf` instead of `grpc.Dial`, so it is required to use `DialTimeout` to not to use RPC timeout. Signed-off-by: Dmitrii Stepanov --- client/client.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/client/client.go b/client/client.go index f6530de..4dd5059 100644 --- a/client/client.go +++ b/client/client.go @@ -100,6 +100,8 @@ func (c *Client) Dial(ctx context.Context, prm PrmDial) error { c.setFrostFSAPIServer((*coreServer)(&c.c)) + ctx, cancel := context.WithTimeout(ctx, prm.DialTimeout) + defer cancel() _, err := rpc.Balance(&c.c, new(v2accounting.BalanceRequest), client.WithContext(ctx), ) -- 2.45.2