Navigation Menu

Skip to content

Commit

Permalink
explicitly set WithWaiterDelay in WaitUntilServiceStable for robustness
Browse files Browse the repository at this point in the history
  • Loading branch information
Songmu committed Sep 9, 2019
1 parent 9f81266 commit 6d20e77
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions ecspresso.go
Expand Up @@ -536,10 +536,14 @@ func (d *App) WaitServiceStable(ctx context.Context, startedAt time.Time) error
}
}()

// Add an option request.WithWaiterMaxAttempts for a long timeout.
// Add an option WithWaiterDelay and request.WithWaiterMaxAttempts for a long timeout.
// SDK Default is 10 min (MaxAttempts=40 * Delay=15sec).
// https://github.com/aws/aws-sdk-go/blob/d57c8d96f72d9475194ccf18d2ba70ac294b0cb3/service/ecs/waiters.go#L82-L83
return d.ecs.WaitUntilServicesStableWithContext(ctx, d.DescribeServicesInput(), request.WithWaiterMaxAttempts(int(d.config.Timeout.Seconds()/15)))
return d.ecs.WaitUntilServicesStableWithContext(
ctx, d.DescribeServicesInput(),
request.WithWaiterDelay(request.ConstantWaiterDelay(15*time.Second)),
request.WithWaiterMaxAttempts(int(d.config.Timeout.Seconds()/15)),
)
}

func (d *App) UpdateService(ctx context.Context, taskDefinitionArn string, count *int64, force bool, sv *ecs.Service) error {
Expand Down

0 comments on commit 6d20e77

Please sign in to comment.