diff --git a/ecspresso.go b/ecspresso.go index 2ebb0573..2b37683c 100644 --- a/ecspresso.go +++ b/ecspresso.go @@ -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 {