From 9d301a42427e50bd4f36985d8418a82fdf57c7b1 Mon Sep 17 00:00:00 2001 From: Dragory <2606411+Dragory@users.noreply.github.com> Date: Sat, 22 Jan 2022 17:20:44 +0200 Subject: [PATCH] debug: reduce 'lowest global remaining' console spam The lowest global remaining rate limit is now only logged when it's below 30, which usually indicates an unusually high amount of API calls. --- backend/src/index.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/backend/src/index.ts b/backend/src/index.ts index deceb3be..f5438991 100644 --- a/backend/src/index.ts +++ b/backend/src/index.ts @@ -390,8 +390,10 @@ connect().then(async () => { }, 100); setInterval(() => { // FIXME: Debug - // tslint:disable-next-line:no-console - console.log("Lowest global remaining in the past 15 seconds:", lowestGlobalRemaining); + if (lowestGlobalRemaining < 30) { + // tslint:disable-next-line:no-console + console.log("[DEBUG] Lowest global remaining in the past 15 seconds:", lowestGlobalRemaining); + } lowestGlobalRemaining = Infinity; }, 15000);