Skip to content

Commit 3852440

Browse files
fix: skip backoff sleep after the final retryAndBackoff attempt (#1937)
Signed-off-by: Zhiwei Liang <zhiwei.liang@zliang.me> Co-authored-by: Joseph Klix <jkl@amazon.com>
1 parent c16f89b commit 3852440

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/helpers.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,13 +260,13 @@ export async function retryAndBackoff<T>(
260260
`Retrying after ${Math.floor(delay)}ms.`,
261261
);
262262

263-
await sleep(delay);
264-
265263
if (nextRetry >= maxRetries) {
266264
core.info(`Retry${opName}: reached max retries (${maxRetries}); giving up.`);
267265
throw err;
268266
}
269267

268+
await sleep(delay);
269+
270270
return await retryAndBackoff(fn, isRetryable, maxRetries, nextRetry, base, label);
271271
}
272272
}

0 commit comments

Comments
 (0)