mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
commit
c7984822ee
|
@ -13,7 +13,7 @@ const (
|
|||
|
||||
type RetryPredicator func(e error) bool
|
||||
|
||||
// Retry retrys the passed functin for "attempts" times, if passed function return error. Setting attemps to zero means keep retrying.
|
||||
// Retry retrys the passed function for "attempts" times, if passed function return error. Setting attempts to zero means keep retrying.
|
||||
func Retry(ctx context.Context, attempts int, duration time.Duration, fnToRetry func() error, errHandler func(error), predicators ...RetryPredicator) (err error) {
|
||||
infinite := false
|
||||
if attempts == InfiniteRetry {
|
||||
|
|
Loading…
Reference in New Issue
Block a user