add stream timeout option which defaults to 0 (#1456)
* add stream timeout option which defaults to 0 * fix option
This commit is contained in:
parent
f03cb96217
commit
5a443abaf1
4
grpc.go
4
grpc.go
@ -221,7 +221,9 @@ func (g *grpcClient) stream(ctx context.Context, node *registry.Node, req client
|
|||||||
}
|
}
|
||||||
|
|
||||||
// set timeout in nanoseconds
|
// set timeout in nanoseconds
|
||||||
header["timeout"] = fmt.Sprintf("%d", opts.RequestTimeout)
|
if opts.StreamTimeout > time.Duration(0) {
|
||||||
|
header["timeout"] = fmt.Sprintf("%d", opts.StreamTimeout)
|
||||||
|
}
|
||||||
// set the content type for the request
|
// set the content type for the request
|
||||||
header["x-content-type"] = req.ContentType()
|
header["x-content-type"] = req.ContentType()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user