Skip to content

Commit

Permalink
fix: graceful shutdown tasks run & wait more for logs (Cloudwatch delay)
Browse files Browse the repository at this point in the history
  • Loading branch information
gumieri committed Jul 10, 2024
1 parent b53d23e commit c231436
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions cmd/task_definitions_run.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,9 +236,8 @@ func taskDefinitionsRunRun(cmd *cobra.Command, args []string) {
}

if exit {
var gracefulStop = make(chan os.Signal)
signal.Notify(gracefulStop, syscall.SIGTERM)
signal.Notify(gracefulStop, syscall.SIGINT)
var gracefulStop = make(chan os.Signal, 1)
signal.Notify(gracefulStop, syscall.SIGTERM, syscall.SIGINT)
go func() {
<-gracefulStop

Expand Down Expand Up @@ -328,7 +327,7 @@ func taskDefinitionsRunRun(cmd *cobra.Command, args []string) {
os.Exit(int(aws.Int64Value(tasksStatus.Tasks[0].Containers[0].ExitCode)))
}

time.Sleep(1 * time.Second)
time.Sleep(5 * time.Second)
}
}

Expand Down

0 comments on commit c231436

Please sign in to comment.