From aa9ebf76317c579361ed3f6290558179cd266a31 Mon Sep 17 00:00:00 2001 From: mat <27899617+mat-1@users.noreply.github.com> Date: Fri, 16 Apr 2021 14:11:00 -0500 Subject: wait 30 seconds and retry on endpoint disabled --- src/hypixelApi.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/hypixelApi.ts b/src/hypixelApi.ts index ee63155..f4c9817 100644 --- a/src/hypixelApi.ts +++ b/src/hypixelApi.ts @@ -151,6 +151,12 @@ export async function sendApiRequest({ path, key, args }): Promise setTimeout(resolve, 30000)) + return await sendApiRequest({ path, key, args }) + } + if (fetchResponse.headers['ratelimit-limit']) // remember how many uses it has apiKeyUsage[key] = { -- cgit