2016-11-07 11:40:11 +03:00
|
|
|
package client
|
|
|
|
|
2016-11-07 19:15:11 +03:00
|
|
|
import "golang.org/x/net/context"
|
2016-11-07 19:10:40 +03:00
|
|
|
|
2016-11-07 19:51:28 +03:00
|
|
|
// note that returning either false or a non-nil error will result in the call not being retried
|
2016-11-07 19:10:40 +03:00
|
|
|
type RetryFunc func(ctx context.Context, req Request, retryCount int, err error) (bool, error)
|
2016-11-07 11:40:11 +03:00
|
|
|
|
|
|
|
// always retry on error
|
2016-11-07 19:10:40 +03:00
|
|
|
func alwaysRetry(ctx context.Context, req Request, retryCount int, err error) (bool, error) {
|
2016-11-07 19:39:05 +03:00
|
|
|
return true, nil
|
2016-11-07 11:40:11 +03:00
|
|
|
}
|