forked from TrueCloudLab/frostfs-sdk-go
[#XX] api: Always call dialer on client connection
Signed-off-by: Airat Arifullin <a.arifullin@yadro.com>
This commit is contained in:
parent
cb813e27a8
commit
ab885d2449
1 changed files with 9 additions and 11 deletions
|
@ -13,19 +13,17 @@ import (
|
|||
var errInvalidEndpoint = errors.New("invalid endpoint options")
|
||||
|
||||
func (c *Client) openGRPCConn(ctx context.Context, dialer func(ctx context.Context, cc grpcstd.ClientConnInterface) error) error {
|
||||
if c.conn != nil {
|
||||
return nil
|
||||
}
|
||||
if c.conn == nil {
|
||||
if c.addr == "" {
|
||||
return errInvalidEndpoint
|
||||
}
|
||||
|
||||
if c.addr == "" {
|
||||
return errInvalidEndpoint
|
||||
}
|
||||
var err error
|
||||
|
||||
var err error
|
||||
|
||||
c.conn, err = grpcstd.NewClient(c.addr, c.grpcDialOpts...)
|
||||
if err != nil {
|
||||
return fmt.Errorf("gRPC new client: %w", err)
|
||||
c.conn, err = grpcstd.NewClient(c.addr, c.grpcDialOpts...)
|
||||
if err != nil {
|
||||
return fmt.Errorf("gRPC new client: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
if dialer != nil {
|
||||
|
|
Loading…
Add table
Reference in a new issue