This commit is contained in:
Damiano Albani 2020-05-12 09:20:09 +02:00 committed by GitHub
parent 62bde6faa2
commit a5bb8d913c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -27,7 +27,7 @@ func (t *Ticker) Tick() { <-t.ticker.C }
func Retry(interval time.Duration, timeout time.Duration, f func() (bool, error)) error {
//TODO: make the retry exponential
if timeout < interval {
return fmt.Errorf("timout(%s) should be greater than interval(%v)", timeout, interval)
return fmt.Errorf("timeout(%s) should be greater than interval(%v)", timeout, interval)
}
tick := &Ticker{time.NewTicker(interval)}
return RetryWorker(interval, timeout, tick, f)