From be996fee8c5b34d56a19410083e3d44a5711270c Mon Sep 17 00:00:00 2001 From: Rafael Gumieri Date: Tue, 7 May 2024 12:08:25 -0300 Subject: [PATCH] fix: look to number of tasks after run on retry --- cmd/task_definitions_run.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/task_definitions_run.go b/cmd/task_definitions_run.go index eeb5bc6..51c2234 100644 --- a/cmd/task_definitions_run.go +++ b/cmd/task_definitions_run.go @@ -164,12 +164,12 @@ func taskDefinitionsRunRun(cmd *cobra.Command, args []string) { var taskResult *ecs.RunTaskOutput for { taskResult, err = ecsI.RunTask(runTaskInput) - if err == nil || retryCount >= retryLimit { + + if err != nil || retryCount >= retryLimit || len(taskResult.Tasks) > 0 { break } retryCount = retryCount + 1 - err = nil time.Sleep(1 * time.Second) }