aboutsummaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
Diffstat (limited to 'build')
-rw-r--r--build/hypixelApi.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/build/hypixelApi.js b/build/hypixelApi.js
index 2b3a601..0656d62 100644
--- a/build/hypixelApi.js
+++ b/build/hypixelApi.js
@@ -71,7 +71,9 @@ async function sendApiRequest({ path, key, args }) {
if (fetchJsonParsed.throttle) {
if (apiKeyUsage[key])
apiKeyUsage[key].remaining = 0;
- return { throttled: true };
+ // if it's throttled, wait 10 seconds and try again
+ await new Promise((resolve) => setTimeout(resolve, 10000));
+ return await sendApiRequest({ path, key, args });
}
return fetchJsonParsed;
}