Add grpc retry (#1160)
* Add grpc retry * Update grpc retry * Add tests * Fix a bug * Add api && some tests * Add comment * Add double check * Add server retry quota * Update optimize code * Fix bug * Update optimize code * Update optimize code * Fix bug
This commit is contained in:
@@ -14,6 +14,8 @@ var (
|
||||
WithDialOption = internal.WithDialOption
|
||||
// WithTimeout is an alias of internal.WithTimeout.
|
||||
WithTimeout = internal.WithTimeout
|
||||
// WithRetry is an alias of internal.WithRetry.
|
||||
WithRetry = internal.WithRetry
|
||||
// WithUnaryClientInterceptor is an alias of internal.WithUnaryClientInterceptor.
|
||||
WithUnaryClientInterceptor = internal.WithUnaryClientInterceptor
|
||||
)
|
||||
@@ -52,6 +54,9 @@ func NewClient(c RpcClientConf, options ...ClientOption) (Client, error) {
|
||||
if c.Timeout > 0 {
|
||||
opts = append(opts, WithTimeout(time.Duration(c.Timeout)*time.Millisecond))
|
||||
}
|
||||
if c.Retry {
|
||||
opts = append(opts, WithRetry())
|
||||
}
|
||||
opts = append(opts, options...)
|
||||
|
||||
var target string
|
||||
|
||||
Reference in New Issue
Block a user