Skip to content

Commit b838ffd

Browse files
committed
fix: prevent extra iterations occurring on getRunIdAndUrl
1 parent 5477224 commit b838ffd

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/return-dispatch.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -779,7 +779,7 @@ describe("return-dispatch", () => {
779779

780780
const getRunIdAndUrlPromise = getRunIdAndUrl({
781781
...defaultOpts,
782-
workflowTimeoutMs: 10 * 1000,
782+
workflowTimeoutMs: 15 * 1000,
783783
});
784784

785785
// First attempt

src/return-dispatch.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,6 @@ export async function getRunIdAndUrl({
146146
let elapsedTime = Date.now() - startTime;
147147
while (elapsedTime < workflowTimeoutMs) {
148148
attemptNo++;
149-
elapsedTime = Date.now() - startTime;
150149

151150
// Get all runs for a given workflow ID
152151
const fetchWorkflowRunIds = await api.retryOrTimeout(
@@ -180,6 +179,7 @@ export async function getRunIdAndUrl({
180179
}
181180

182181
await sleep(constants.WORKFLOW_JOB_STEPS_RETRY_MS);
182+
elapsedTime = Date.now() - startTime;
183183
}
184184

185185
return { success: false, reason: "timeout" };

0 commit comments

Comments
 (0)