mirror of
https://github.com/go-micro/go-micro.git
synced 2025-08-04 21:42:57 +02:00
fix options
This commit is contained in:
@ -89,7 +89,7 @@ type CallOptions struct {
|
|||||||
CallWrappers []CallWrapper
|
CallWrappers []CallWrapper
|
||||||
|
|
||||||
// ConnectionTimeout of one request to the server.
|
// ConnectionTimeout of one request to the server.
|
||||||
// Set this lower than the RequestTimeout to enbale retries on connection timeout.
|
// Set this lower than the RequestTimeout to enable retries on connection timeout.
|
||||||
ConnectionTimeout time.Duration
|
ConnectionTimeout time.Duration
|
||||||
// Request/Response timeout of entire srv.Call, for single request timeout set ConnectionTimeout.
|
// Request/Response timeout of entire srv.Call, for single request timeout set ConnectionTimeout.
|
||||||
RequestTimeout time.Duration
|
RequestTimeout time.Duration
|
||||||
@ -261,6 +261,13 @@ func Retry(fn RetryFunc) Option {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ConnectionTimeout sets the connection timeout
|
||||||
|
func ConnectionTimeout(t time.Duration) Option {
|
||||||
|
return func(o *Options) {
|
||||||
|
o.CallOptions.ConnectionTimeout = t
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// RequestTimeout set the request timeout.
|
// RequestTimeout set the request timeout.
|
||||||
func RequestTimeout(d time.Duration) Option {
|
func RequestTimeout(d time.Duration) Option {
|
||||||
return func(o *Options) {
|
return func(o *Options) {
|
||||||
|
Reference in New Issue
Block a user