Skip to content

Commit

Permalink
Fix restartAttemptPeriod comparison in restart tracker
Browse files Browse the repository at this point in the history
  • Loading branch information
timj-hh committed Jul 2, 2024
1 parent 6d6c9a8 commit acafb2b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ecs-agent/api/container/restart/restart_tracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func (rt *RestartTracker) ShouldRestart(exitCode *int, startedAt time.Time,
if !rt.LastRestartAt.IsZero() {
startTime = rt.LastRestartAt
}
if time.Since(startTime) < time.Duration(rt.RestartPolicy.RestartAttemptPeriod)*time.Second {
if time.Since(startTime).Seconds() < float64(rt.RestartPolicy.RestartAttemptPeriod) {
return false, "attempt reset period has not elapsed"
}
return true, ""
Expand Down

0 comments on commit acafb2b

Please sign in to comment.