Skip to content

Commit

Permalink
Enable longer wait times for ECS tasks to complete
Browse files Browse the repository at this point in the history
  • Loading branch information
ipmb committed Mar 1, 2022
1 parent 455aac5 commit 62c4792
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"github.com/apppackio/apppack/auth"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/aws/request"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/codebuild"
"github.com/aws/aws-sdk-go/service/dynamodb"
Expand Down Expand Up @@ -473,7 +474,13 @@ func (a *App) WaitForTaskStopped(task *ecs.Task) (*int64, error) {
Cluster: task.ClusterArn,
Tasks: []*string{task.TaskArn},
}
err := ecsSvc.WaitUntilTasksStopped(&input)
// MaxSessionDurationSeconds is 3600. This will wait _almost_ that long
err := ecsSvc.WaitUntilTasksStoppedWithContext(
aws.BackgroundContext(),
&input,
request.WithWaiterMaxAttempts(595),
request.WithWaiterDelay(request.ConstantWaiterDelay(6*time.Second)),
)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 62c4792

Please sign in to comment.