Skip to content

Commit 8682a43

Browse files
committed
fix: add maxDelay to prevent exponential backoff in waiters
1 parent cbf54ec commit 8682a43

3 files changed

Lines changed: 13 additions & 0 deletions

File tree

dist/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ async function waitForTasksStopped(ecs, clusterName, taskArns, waitForMinutes) {
161161
const waitTaskResponse = await waitUntilTasksStopped({
162162
client: ecs,
163163
minDelay: WAIT_DEFAULT_DELAY_SEC,
164+
maxDelay: WAIT_DEFAULT_DELAY_SEC,
164165
maxWaitTime: waitForMinutes * 60,
165166
}, {
166167
cluster: clusterName,
@@ -245,6 +246,7 @@ async function updateEcsService(ecs, clusterName, service, taskDefArn, waitForSe
245246
await waitUntilServicesStable({
246247
client: ecs,
247248
minDelay: WAIT_DEFAULT_DELAY_SEC,
249+
maxDelay: WAIT_DEFAULT_DELAY_SEC,
248250
maxWaitTime: waitForMinutes * 60
249251
}, {
250252
services: [service],
@@ -463,6 +465,7 @@ async function createCodeDeployDeployment(codedeploy, clusterName, service, task
463465
await waitUntilDeploymentSuccessful({
464466
client: codedeploy,
465467
minDelay: WAIT_DEFAULT_DELAY_SEC,
468+
maxDelay: WAIT_DEFAULT_DELAY_SEC,
466469
maxWaitTime: totalWaitMin * 60
467470
}, {
468471
deploymentId: createDeployResponse.deploymentId

index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ async function waitForTasksStopped(ecs, clusterName, taskArns, waitForMinutes) {
155155
const waitTaskResponse = await waitUntilTasksStopped({
156156
client: ecs,
157157
minDelay: WAIT_DEFAULT_DELAY_SEC,
158+
maxDelay: WAIT_DEFAULT_DELAY_SEC,
158159
maxWaitTime: waitForMinutes * 60,
159160
}, {
160161
cluster: clusterName,
@@ -239,6 +240,7 @@ async function updateEcsService(ecs, clusterName, service, taskDefArn, waitForSe
239240
await waitUntilServicesStable({
240241
client: ecs,
241242
minDelay: WAIT_DEFAULT_DELAY_SEC,
243+
maxDelay: WAIT_DEFAULT_DELAY_SEC,
242244
maxWaitTime: waitForMinutes * 60
243245
}, {
244246
services: [service],
@@ -457,6 +459,7 @@ async function createCodeDeployDeployment(codedeploy, clusterName, service, task
457459
await waitUntilDeploymentSuccessful({
458460
client: codedeploy,
459461
minDelay: WAIT_DEFAULT_DELAY_SEC,
462+
maxDelay: WAIT_DEFAULT_DELAY_SEC,
460463
maxWaitTime: totalWaitMin * 60
461464
}, {
462465
deploymentId: createDeployResponse.deploymentId

index.test.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -684,6 +684,7 @@ describe('Deploy to ECS', () => {
684684
{
685685
client: mockCodeDeployClient,
686686
minDelay: 15,
687+
maxDelay: 15,
687688
maxWaitTime: (
688689
EXPECTED_DEFAULT_WAIT_TIME +
689690
EXPECTED_CODE_DEPLOY_TERMINATION_WAIT_TIME +
@@ -763,6 +764,7 @@ describe('Deploy to ECS', () => {
763764
{
764765
client: mockCodeDeployClient,
765766
minDelay: 15,
767+
maxDelay: 15,
766768
maxWaitTime: (
767769
60 +
768770
EXPECTED_CODE_DEPLOY_TERMINATION_WAIT_TIME +
@@ -840,6 +842,7 @@ describe('Deploy to ECS', () => {
840842
{
841843
client: mockCodeDeployClient,
842844
minDelay: 15,
845+
maxDelay: 15,
843846
maxWaitTime: 6 * 60 * 60,
844847
},
845848
{
@@ -1036,6 +1039,7 @@ describe('Deploy to ECS', () => {
10361039
{
10371040
client: mockCodeDeployClient,
10381041
minDelay: 15,
1042+
maxDelay: 15,
10391043
maxWaitTime: (
10401044
EXPECTED_DEFAULT_WAIT_TIME +
10411045
EXPECTED_CODE_DEPLOY_TERMINATION_WAIT_TIME +
@@ -1107,6 +1111,7 @@ describe('Deploy to ECS', () => {
11071111
{
11081112
client: mockEcsClient,
11091113
minDelay: 15,
1114+
maxDelay: 15,
11101115
maxWaitTime: EXPECTED_DEFAULT_WAIT_TIME * 60,
11111116
},
11121117
{
@@ -1150,6 +1155,7 @@ describe('Deploy to ECS', () => {
11501155
{
11511156
client: mockEcsClient,
11521157
minDelay: 15,
1158+
maxDelay: 15,
11531159
maxWaitTime: 60 * 60,
11541160
},
11551161
{
@@ -1193,6 +1199,7 @@ describe('Deploy to ECS', () => {
11931199
{
11941200
client: mockEcsClient,
11951201
minDelay: 15,
1202+
maxDelay: 15,
11961203
maxWaitTime: 6 * 60 * 60,
11971204
},
11981205
{

0 commit comments

Comments
 (0)