forked from TrueCloudLab/frostfs-sdk-go
[#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 <d.stepanov@yadro.com>
This commit is contained in:
parent
997346ef95
commit
4c310ae1c7
1 changed files with 2 additions and 0 deletions
|
@ -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),
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue