Bumps the standard retry up.

This commit is contained in:
James Phillips 2018-02-07 17:29:30 -08:00
parent beee26cd48
commit 18335da27e
No known key found for this signature in database
GPG Key ID: 77183E682AC5FC11
1 changed files with 6 additions and 1 deletions

View File

@ -82,7 +82,7 @@ func decorate(s string) string {
}
func Run(t Failer, f func(r *R)) {
run(TwoSeconds(), t, f)
run(DefaultFailer(), t, f)
}
func RunWith(r Retryer, t Failer, f func(r *R)) {
@ -133,6 +133,11 @@ func run(r Retryer, t Failer, f func(r *R)) {
}
}
// DefaultFailer provides default retry.Run() behavior for unit tests.
func DefaultFailer() *Timer {
return &Timer{Timeout: 7 * time.Second, Wait: 25 * time.Millisecond}
}
// TwoSeconds repeats an operation for two seconds and waits 25ms in between.
func TwoSeconds() *Timer {
return &Timer{Timeout: 2 * time.Second, Wait: 25 * time.Millisecond}