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 Liang
2026-08-28 14:03:00 -04:00
committed by GitHub
parent c16f89bdf4
commit 3852440c21
+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);
}
}