From b814e3ba61a1a699f53aebb19cd42a0dc79dd241 Mon Sep 17 00:00:00 2001 From: Paul D'Ambra Date: Wed, 31 Jan 2024 14:04:02 +0000 Subject: [PATCH] moving on up as the m people and primal scream both said --- src/rate-limiter.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/rate-limiter.ts b/src/rate-limiter.ts index 8f8eddb83..67860acf3 100644 --- a/src/rate-limiter.ts +++ b/src/rate-limiter.ts @@ -20,13 +20,13 @@ export class RateLimiter { } public checkForLimiting = (httpResponse: MinimalHTTPResponse): void => { - let text: string | undefined - try { - text = httpResponse.responseText - if (!text || !text.length) { - return - } + const text: string | undefined = httpResponse.responseText + if (!text || !text.length) { + return + } + + try { const response: CaptureResponse = JSON.parse(text) const quotaLimitedProducts = response.quota_limited || [] quotaLimitedProducts.forEach((batchKey) => {