Skip to content

Commit 852e0a1

Browse files
committed
fix: use the highest timeout value when retrying
1 parent d8c15b5 commit 852e0a1

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

src/main.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,13 @@ async function run(): Promise<void> {
3939
// Get all runs for a given workflow ID
4040
const fetchWorkflowRunIds = await api.retryOrTimeout(
4141
() => api.getWorkflowRunIds(workflowId),
42-
WORKFLOW_FETCH_TIMEOUT_MS > timeoutMs
43-
? timeoutMs
44-
: WORKFLOW_FETCH_TIMEOUT_MS,
42+
Math.max(WORKFLOW_FETCH_TIMEOUT_MS, timeoutMs),
4543
);
4644
if (fetchWorkflowRunIds.timeout) {
47-
core.debug("Timed out while attempting to fetch Workflow Run IDs");
48-
await new Promise((resolve) =>
49-
setTimeout(resolve, WORKFLOW_JOB_STEPS_RETRY_MS),
45+
core.debug(
46+
`Timed out while attempting to fetch Workflow Run IDs, waited ${Date.now() - startTime}ms`,
5047
);
51-
continue;
48+
break;
5249
}
5350

5451
const workflowRunIds = fetchWorkflowRunIds.value;

0 commit comments

Comments
 (0)