From 6b19f7ffe6053c7204484555e81970d3740ae055 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Thu, 11 Sep 2025 18:23:03 +0000 Subject: [PATCH] chore: Update dist --- dist/cleanup/index.js | 13 +++++++++---- dist/index.js | 13 +++++++++---- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/dist/cleanup/index.js b/dist/cleanup/index.js index 6ca713d..8ccafce 100644 --- a/dist/cleanup/index.js +++ b/dist/cleanup/index.js @@ -49799,15 +49799,20 @@ async function retryAndBackoff(fn, isRetryable, maxRetries = 12, retries = 0, ba } catch (err) { if (!isRetryable) { + core.debug(`retryAndBackoff: error is not retryable: ${errorMessage(err)}`); throw err; } // It's retryable, so sleep and retry. - await sleep(Math.random() * (2 ** retries * base)); - retries += 1; - if (retries >= maxRetries) { + const delay = Math.random() * (2 ** retries * base); + const nextRetry = retries + 1; + core.debug(`retryAndBackoff: attempt ${nextRetry} of ${maxRetries} failed: ${errorMessage(err)}. ` + + `Retrying after ${Math.floor(delay)}ms.`); + await sleep(delay); + if (nextRetry >= maxRetries) { + core.debug('retryAndBackoff: reached max retries; giving up.'); throw err; } - return await retryAndBackoff(fn, isRetryable, maxRetries, retries, base); + return await retryAndBackoff(fn, isRetryable, maxRetries, nextRetry, base); } } /* c8 ignore start */ diff --git a/dist/index.js b/dist/index.js index db363ea..d3f467b 100644 --- a/dist/index.js +++ b/dist/index.js @@ -529,15 +529,20 @@ async function retryAndBackoff(fn, isRetryable, maxRetries = 12, retries = 0, ba } catch (err) { if (!isRetryable) { + core.debug(`retryAndBackoff: error is not retryable: ${errorMessage(err)}`); throw err; } // It's retryable, so sleep and retry. - await sleep(Math.random() * (2 ** retries * base)); - retries += 1; - if (retries >= maxRetries) { + const delay = Math.random() * (2 ** retries * base); + const nextRetry = retries + 1; + core.debug(`retryAndBackoff: attempt ${nextRetry} of ${maxRetries} failed: ${errorMessage(err)}. ` + + `Retrying after ${Math.floor(delay)}ms.`); + await sleep(delay); + if (nextRetry >= maxRetries) { + core.debug('retryAndBackoff: reached max retries; giving up.'); throw err; } - return await retryAndBackoff(fn, isRetryable, maxRetries, retries, base); + return await retryAndBackoff(fn, isRetryable, maxRetries, nextRetry, base); } } /* c8 ignore start */