aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/constants.ts4
-rw-r--r--src/hypixelApi.ts9
-rw-r--r--src/index.ts2
3 files changed, 3 insertions, 12 deletions
diff --git a/src/constants.ts b/src/constants.ts
index 6c5c1c5..52c104c 100644
--- a/src/constants.ts
+++ b/src/constants.ts
@@ -47,8 +47,7 @@ async function fetchGithubApi(method: string, route: string, headers?: any, json
}, headers),
}
)
- } catch (err) {
- console.log('bruh, errored', err)
+ } catch {
// if there's an error, wait a second and try again
await new Promise((resolve) => setTimeout(resolve, 1000))
return await fetchGithubApi(method, route, headers, json)
@@ -87,7 +86,6 @@ function fetchFile(path: string): Promise<GithubFile> {
},
)
const data = await r.json()
- console.log('ok github api returned')
const file = {
path: data.path,
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
}
diff --git a/src/index.ts b/src/index.ts
index 6f3b94f..1652428 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -6,7 +6,7 @@ import express from 'express'
const app = express()
-export const debug = true
+export const debug = false
// 200 requests over 5 minutes