Skip to content

Commit

Permalink
fix: don't recalculate retry timeout on each iteration
Browse files Browse the repository at this point in the history
  • Loading branch information
Codex- committed Oct 3, 2024
1 parent 70f564e commit 9a80ce7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/return-dispatch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,10 @@ export async function getRunIdAndUrl({
workflowTimeoutMs,
}: GetRunIdAndUrlOpts): Promise<Result<{ id: number; url: string }>> {
const distinctIdRegex = new RegExp(distinctId);
const retryTimeout = Math.max(
constants.WORKFLOW_FETCH_TIMEOUT_MS,
workflowTimeoutMs,
);

core.info("Attempt to identify run ID from steps...");
core.debug(`Attempting to identify Run ID for ${workflow} (${workflowId})`);
Expand All @@ -146,7 +150,7 @@ export async function getRunIdAndUrl({
// Get all runs for a given workflow ID
const fetchWorkflowRunIds = await api.retryOrTimeout(
() => api.fetchWorkflowRunIds(workflowId, branch),
Math.max(constants.WORKFLOW_FETCH_TIMEOUT_MS, workflowTimeoutMs),
retryTimeout,
);
if (!fetchWorkflowRunIds.success) {
core.debug(
Expand Down

0 comments on commit 9a80ce7

Please sign in to comment.