From e47fbe6a4e73cd8d31e05ac40c3707fe40381c70 Mon Sep 17 00:00:00 2001 From: Tim Harrold Date: Tue, 2 Jul 2024 19:17:05 +0000 Subject: [PATCH] TEST dbueg lcr again --- ecs-agent/api/container/restart/restart_tracker.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ecs-agent/api/container/restart/restart_tracker.go b/ecs-agent/api/container/restart/restart_tracker.go index b57e8056bcc..a8e965fa9a4 100644 --- a/ecs-agent/api/container/restart/restart_tracker.go +++ b/ecs-agent/api/container/restart/restart_tracker.go @@ -92,6 +92,7 @@ func (rt *RestartTracker) ShouldRestart(exitCode *int, startedAt time.Time, startTime := startedAt if !rt.LastRestartAt.IsZero() { logger.Info("HELLO WORLD") + fmt.Println("HELLO WORLD 2") startTime = rt.LastRestartAt } logger.Info("HELLO WORLD", @@ -102,6 +103,14 @@ func (rt *RestartTracker) ShouldRestart(exitCode *int, startedAt time.Time, "ResetAttemptPeriod": time.Duration(rt.RestartPolicy.RestartAttemptPeriod), "IntAttemptPeriod": rt.RestartPolicy.RestartAttemptPeriod, }) + fmt.Println("HELLO WORLD 2", + 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" }