From c8dbc683bfa33302de4079a8b1374c6674ba4b9b Mon Sep 17 00:00:00 2001 From: Brett Hoerner Date: Thu, 19 Oct 2023 09:10:37 -0600 Subject: [PATCH] fix(plugin-server): clarify var name in retryIfRetriable (#18093) --- plugin-server/src/utils/retries.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugin-server/src/utils/retries.ts b/plugin-server/src/utils/retries.ts index ec28686daa315..4fc6fca9124b8 100644 --- a/plugin-server/src/utils/retries.ts +++ b/plugin-server/src/utils/retries.ts @@ -158,13 +158,13 @@ export async function runRetriableFunction(retriableFunctionPayload: RetriableFu /** * Retry a function, respecting `error.isRetriable`. */ -export async function retryIfRetriable(fn: () => Promise, retries = 3, sleepMs = 500): Promise { - for (let i = 0; i < retries; i++) { +export async function retryIfRetriable(fn: () => Promise, tries = 3, sleepMs = 500): Promise { + for (let i = 0; i < tries; i++) { try { return await fn() } catch (error) { - if (error?.isRetriable === false || i === retries - 1) { - // Throw if the error is not retryable or if we're out of retries. + if (error?.isRetriable === false || i === tries - 1) { + // Throw if the error is not retryable or if we're out of tries. throw error }