diff options
Diffstat (limited to 'src/constants.ts')
-rw-r--r-- | src/constants.ts | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/constants.ts b/src/constants.ts index 52c104c..48f9619 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -36,7 +36,7 @@ const queue = new Queue({ async function fetchGithubApi(method: string, route: string, headers?: any, json?: any): Promise<nodeFetch.Response> { try { if (debug) console.debug('fetching github api', method, route) - return await fetch( + const data = await fetch( githubApiBase + route, { agent: () => httpsAgent, @@ -47,6 +47,8 @@ async function fetchGithubApi(method: string, route: string, headers?: any, json }, headers), } ) + if (debug) console.debug('fetched github api', method, route) + return data } catch { // if there's an error, wait a second and try again await new Promise((resolve) => setTimeout(resolve, 1000)) |