Skip to content

Commit

Permalink
fix: force a last loop to capture logs on tasks run
Browse files Browse the repository at this point in the history
  • Loading branch information
gumieri committed Jul 11, 2024
1 parent c231436 commit cd1bad9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cmd/task_definitions_run.go
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@ func taskDefinitionsRunRun(cmd *cobra.Command, args []string) {
return !lastPage
}

lastRun := false
retryCount = 0
retryLimit = 50
for {
Expand Down Expand Up @@ -324,7 +325,10 @@ func taskDefinitionsRunRun(cmd *cobra.Command, args []string) {

status := aws.StringValue(tasksStatus.Tasks[0].LastStatus)
if status == "STOPPED" {
os.Exit(int(aws.Int64Value(tasksStatus.Tasks[0].Containers[0].ExitCode)))
if lastRun {
os.Exit(int(aws.Int64Value(tasksStatus.Tasks[0].Containers[0].ExitCode)))
}
lastRun = true
}

time.Sleep(5 * time.Second)
Expand Down

0 comments on commit cd1bad9

Please sign in to comment.