Skip to content

Commit

Permalink
fix: use the highest timeout value when retrying
Browse files Browse the repository at this point in the history
  • Loading branch information
Codex- committed Sep 26, 2024
1 parent d8c15b5 commit 852e0a1
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,13 @@ async function run(): Promise<void> {
// Get all runs for a given workflow ID
const fetchWorkflowRunIds = await api.retryOrTimeout(
() => api.getWorkflowRunIds(workflowId),
WORKFLOW_FETCH_TIMEOUT_MS > timeoutMs
? timeoutMs
: WORKFLOW_FETCH_TIMEOUT_MS,
Math.max(WORKFLOW_FETCH_TIMEOUT_MS, timeoutMs),
);
if (fetchWorkflowRunIds.timeout) {
core.debug("Timed out while attempting to fetch Workflow Run IDs");
await new Promise((resolve) =>
setTimeout(resolve, WORKFLOW_JOB_STEPS_RETRY_MS),
core.debug(
`Timed out while attempting to fetch Workflow Run IDs, waited ${Date.now() - startTime}ms`,
);
continue;
break;
}

const workflowRunIds = fetchWorkflowRunIds.value;
Expand Down

0 comments on commit 852e0a1

Please sign in to comment.