Skip to content

Commit 52dd75e

Browse files
inhumantsartrivikr
andcommitted
Apply suggestions from code review
Co-authored-by: Trivikram Kamat <[email protected]>
1 parent b37bd35 commit 52dd75e

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

index.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ async function runTask(ecs, clusterName, taskDefArn, waitForMinutes) {
5050
},
5151
launchType: launchType,
5252
networkConfiguration: awsvpcConfiguration === {} ? {} : { awsvpcConfiguration: awsvpcConfiguration }
53-
}).promise();
53+
});
5454

5555
core.debug(`Run task response ${JSON.stringify(runTaskResponse)}`)
5656

@@ -80,14 +80,14 @@ async function waitForTasksStopped(ecs, clusterName, taskArns, waitForMinutes) {
8080

8181
core.info(`Waiting for tasks to stop. Will wait for ${waitForMinutes} minutes`);
8282

83-
const waitTaskResponse = await ecs.waitFor('tasksStopped', {
83+
const waitTaskResponse = await waitUntilTasksStopped({
84+
client: ecs,
85+
minDelay: WAIT_DEFAULT_DELAY_SEC,
86+
maxWaitTime: waitForMinutes * 60,
87+
}, {
8488
cluster: clusterName,
8589
tasks: taskArns,
86-
$waiter: {
87-
delay: WAIT_DEFAULT_DELAY_SEC,
88-
maxAttempts: (waitForMinutes * 60) / WAIT_DEFAULT_DELAY_SEC
89-
}
90-
}).promise();
90+
});
9191

9292
core.debug(`Run task response ${JSON.stringify(waitTaskResponse)}`);
9393
core.info('All tasks have stopped.');
@@ -98,7 +98,7 @@ async function tasksExitCode(ecs, clusterName, taskArns) {
9898
const describeResponse = await ecs.describeTasks({
9999
cluster: clusterName,
100100
tasks: taskArns
101-
}).promise();
101+
});
102102

103103
const containers = [].concat(...describeResponse.tasks.map(task => task.containers))
104104
const exitCodes = containers.map(container => container.exitCode)

0 commit comments

Comments
 (0)