Skip to content

Commit 9a80ce7

Browse files
committed
fix: don't recalculate retry timeout on each iteration
1 parent 70f564e commit 9a80ce7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/return-dispatch.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,10 @@ export async function getRunIdAndUrl({
133133
workflowTimeoutMs,
134134
}: GetRunIdAndUrlOpts): Promise<Result<{ id: number; url: string }>> {
135135
const distinctIdRegex = new RegExp(distinctId);
136+
const retryTimeout = Math.max(
137+
constants.WORKFLOW_FETCH_TIMEOUT_MS,
138+
workflowTimeoutMs,
139+
);
136140

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

0 commit comments

Comments
 (0)