Skip to content

Commit

Permalink
TEST debug lcr
Browse files Browse the repository at this point in the history
  • Loading branch information
timj-hh committed Jul 2, 2024
1 parent 6d6c9a8 commit ce27f1f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions ecs-agent/api/container/restart/restart_tracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"time"

apicontainerstatus "github.com/aws/amazon-ecs-agent/ecs-agent/api/container/status"
"github.com/aws/amazon-ecs-agent/ecs-agent/logger"
)

type RestartTracker struct {
Expand Down Expand Up @@ -90,8 +91,17 @@ func (rt *RestartTracker) ShouldRestart(exitCode *int, startedAt time.Time,

startTime := startedAt
if !rt.LastRestartAt.IsZero() {
logger.Info("HELLO WORLD")
startTime = rt.LastRestartAt
}
logger.Info("HELLO WORLD",
logger.Fields{
"HasElapsed": time.Since(startTime) < time.Duration(rt.RestartPolicy.RestartAttemptPeriod)*time.Second,
"TimeSince": time.Since(startTime),
"AttemptPeriodSeconds": time.Duration(rt.RestartPolicy.RestartAttemptPeriod) * time.Second,
"ResetAttemptPeriod": time.Duration(rt.RestartPolicy.RestartAttemptPeriod),
"IntAttemptPeriod": rt.RestartPolicy.RestartAttemptPeriod,
})
if time.Since(startTime) < time.Duration(rt.RestartPolicy.RestartAttemptPeriod)*time.Second {
return false, "attempt reset period has not elapsed"
}
Expand Down

0 comments on commit ce27f1f

Please sign in to comment.