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>
This commit is contained in:
Zhiwei LiangandJoseph Klix authored and GitHub committed 2026-08-28 18:03:00 +00:00
1 parent c16f89bdf4
commit 3852440c21
1 file changed
+2 -2
+2 -2
View File
@@ -260,13 +260,13 @@ export async function retryAndBackoff<T>(
`Retrying after ${Math.floor(delay)}ms.`,
);
await sleep(delay);
if (nextRetry >= maxRetries) {
core.info(`Retry${opName}: reached max retries (${maxRetries}); giving up.`);
throw err;
}
await sleep(delay);
return await retryAndBackoff(fn, isRetryable, maxRetries, nextRetry, base, label);
}
}