add context dialer option
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
parent
e97e4580a1
commit
251f06cc31
8
grpc.go
8
grpc.go
@ -122,6 +122,14 @@ func (g *grpcClient) call(ctx context.Context, addr string, req client.Request,
|
||||
grpcDialOptions = append(grpcDialOptions, opts...)
|
||||
}
|
||||
|
||||
contextDialer := g.opts.ContextDialer
|
||||
if opts.ContextDialer != nil {
|
||||
contextDialer = opts.ContextDialer
|
||||
}
|
||||
if contextDialer != nil {
|
||||
grpcDialOptions = append(grpcDialOptions, grpc.WithContextDialer(contextDialer))
|
||||
}
|
||||
|
||||
cc, err := g.pool.getConn(dialCtx, addr, grpcDialOptions...)
|
||||
if err != nil {
|
||||
return errors.InternalServerError("go.micro.client", fmt.Sprintf("Error sending request: %v", err))
|
||||
|
Loading…
x
Reference in New Issue
Block a user