Skip to content

Commit

Permalink
Update driver.go
Browse files Browse the repository at this point in the history
  • Loading branch information
s4ke authored Apr 23, 2024
1 parent 714ab17 commit e6b0772
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,12 @@ type hetznerDriver struct {
}

func (hd *hetznerDriver) checkBackoff() error {
if time.Now().Before(hd.nextTry) {
return fmt.Errorf("last failure too recent; waiting a bit before retrying")
}
return nil
now := time.Now()
if now.Before(hd.nextTry) {
waitDuration := time.Until(hd.nextTry)
return fmt.Errorf("last failure too recent; failed %d times in a row before this; retry after %s", hd.failuresInARow, waitDuration)
}
return nil
}

func (hd *hetznerDriver) handleBackoff(err error) {
Expand Down

0 comments on commit e6b0772

Please sign in to comment.