add context dialer option
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
parent
251f06cc31
commit
6e91cd5cf5
8
grpc.go
8
grpc.go
@ -231,6 +231,14 @@ func (g *grpcClient) stream(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…
Reference in New Issue
Block a user