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 3, 2024
1 parent c0d9eb8 commit 172bdb3
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 172bdb3

Please sign in to comment.