aboutsummaryrefslogtreecommitdiff
path: root/src/hypixelApi.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/hypixelApi.ts')
-rw-r--r--src/hypixelApi.ts9
1 files changed, 1 insertions, 8 deletions
diff --git a/src/hypixelApi.ts b/src/hypixelApi.ts
index 35d46cb..fdb4535 100644
--- a/src/hypixelApi.ts
+++ b/src/hypixelApi.ts
@@ -145,8 +145,7 @@ export async function sendApiRequest({ path, key, args }): Promise<HypixelRespon
{ agent: () => httpsAgent }
)
fetchJsonParsed = await fetchResponse.json()
- } catch (err) {
- console.debug('error? ok retrying', err)
+ } catch {
// if there's an error, wait a second and try again
await new Promise((resolve) => setTimeout(resolve, 1000))
return await sendApiRequest({ path, key, args })
@@ -167,18 +166,12 @@ export async function sendApiRequest({ path, key, args }): Promise<HypixelRespon
}
if (fetchJsonParsed.throttle) {
- console.log('bruh, throttled')
if (apiKeyUsage[key])
apiKeyUsage[key].remaining = 0
// if it's throttled, wait 10 seconds and try again
await new Promise((resolve) => setTimeout(resolve, 10000))
return await sendApiRequest({ path, key, args })
}
-
- console.log(path, args, fetchJsonParsed.success)
- if (!fetchJsonParsed.success) {
- console.log(fetchJsonParsed)
- }
return fetchJsonParsed
}