refactored deprecated code
This commit is contained in:
@@ -56,8 +56,6 @@ func New(ctx context.Context, cfg Config, opts ...grpc.DialOption) (Client, erro
|
||||
}
|
||||
|
||||
func dial(ctx context.Context, cfg Config, address string, opts ...grpc.DialOption) (*grpc.ClientConn, error) {
|
||||
dialCtx, cancel := context.WithTimeout(ctx, cfg.DialTimeout)
|
||||
defer cancel()
|
||||
dialOpts := make([]grpc.DialOption, 0, len(opts)+1)
|
||||
dialOpts = append(dialOpts, opts...)
|
||||
|
||||
@@ -67,7 +65,7 @@ func dial(ctx context.Context, cfg Config, address string, opts ...grpc.DialOpti
|
||||
dialOpts = append(dialOpts, grpc.WithTransportCredentials(credentials.NewTLS(&tls.Config{})))
|
||||
}
|
||||
|
||||
conn, err := grpc.DialContext(dialCtx, address, dialOpts...)
|
||||
conn, err := grpc.NewClient(address, dialOpts...)
|
||||
if err != nil {
|
||||
return nil, merrors.InternalWrap(err, fmt.Sprintf("payment-orchestrator: dial %s", address))
|
||||
}
|
||||
|
||||
@@ -451,5 +451,5 @@ func dialGrpc(ctx context.Context, endpoint discoveryEndpoint) (*grpc.ClientConn
|
||||
if ctx == nil {
|
||||
ctx = context.Background()
|
||||
}
|
||||
return grpc.DialContext(ctx, endpoint.address, dialOpts...)
|
||||
return grpc.NewClient(endpoint.address, dialOpts...)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user