Merge pull request #103 from unistack-org/ctx_dialer
add context dialer option
This commit is contained in:
commit
8c222c4715
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