mirror of
https://github.com/go-micro/go-micro.git
synced 2025-06-12 22:07:47 +02:00
Adjusting the logic around the returned error from the retry function
This commit is contained in:
@ -2,9 +2,10 @@ package client
|
||||
|
||||
import "golang.org/x/net/context"
|
||||
|
||||
// note that returning either true or a non-nil error will result in the call not being retried
|
||||
type RetryFunc func(ctx context.Context, req Request, retryCount int, err error) (bool, error)
|
||||
|
||||
// always retry on error
|
||||
func alwaysRetry(ctx context.Context, req Request, retryCount int, err error) (bool, error) {
|
||||
return true, err
|
||||
return true, nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user