1
0
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:
Scott Finlay
2016-11-07 17:39:05 +01:00
parent c6737ac64c
commit a6812ba332
2 changed files with 16 additions and 4 deletions

View File

@ -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
}