Skip to content

Commit

Permalink
Interval can be nil
Browse files Browse the repository at this point in the history
  • Loading branch information
dangra committed Jan 25, 2023
1 parent 858afd8 commit 1767d9c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions internal/command/deploy/machines.go
Original file line number Diff line number Diff line change
Expand Up @@ -254,11 +254,13 @@ func (lm *leasableMachine) WaitForHealthchecksToPass(ctx context.Context, timeou
}
waitCtx, cancel := context.WithTimeout(ctx, timeout)
defer cancel()

shortestInterval := 120 * time.Second
for _, c := range lm.Machine().Config.Checks {
ci := c.Interval.Duration
if ci < shortestInterval {
shortestInterval = ci
if c.Interval != nil {
if c.Interval.Duration < shortestInterval {
shortestInterval = c.Interval.Duration
}
}
}
b := &backoff.Backoff{
Expand All @@ -267,6 +269,7 @@ func (lm *leasableMachine) WaitForHealthchecksToPass(ctx context.Context, timeou
Factor: 2,
Jitter: true,
}

printedFirst := false
for {
updateMachine, err := lm.flapsClient.Get(waitCtx, lm.Machine().ID)
Expand Down

0 comments on commit 1767d9c

Please sign in to comment.