Skip to content

Commit

Permalink
fix: exponential backoff
Browse files Browse the repository at this point in the history
  • Loading branch information
tullo committed Apr 27, 2021
1 parent 211882f commit ee0af57
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion dockertest.go
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,15 @@ func (d *Pool) Retry(op func() error) error {
bo := backoff.NewExponentialBackOff()
bo.MaxInterval = time.Second * 5
bo.MaxElapsedTime = d.MaxWait
return backoff.Retry(op, bo)
if err := backoff.Retry(op, bo); err != nil {
if bo.NextBackOff() == backoff.Stop {
return fmt.Errorf("reached retry deadline")
}

return err
}

return nil
}

// CurrentContainer returns current container descriptor if this function called within running container.
Expand Down

0 comments on commit ee0af57

Please sign in to comment.