From 067b80e0eba17f1e2e2424dc7d62ee50336de9c4 Mon Sep 17 00:00:00 2001 From: Skillz4Killz Date: Wed, 16 Dec 2020 14:28:20 -0500 Subject: [PATCH] fix max stack i hope --- src/module/requestManager.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/module/requestManager.ts b/src/module/requestManager.ts index 2c9563421..a1bdd4d7f 100644 --- a/src/module/requestManager.ts +++ b/src/module/requestManager.ts @@ -62,8 +62,7 @@ async function cleanupQueues() { } async function processQueue() { - // Putting this code inside a function like this allows us to use tail recursion like a while loop without hitting the max stack error. - async function avoidMaxStackError() { + while (queueInProcess) { if ( (Object.keys(pathQueues).length) && !globallyRateLimited ) { @@ -110,12 +109,9 @@ async function processQueue() { } if (Object.keys(pathQueues).length) { - avoidMaxStackError(); cleanupQueues(); } else queueInProcess = false; } - - return avoidMaxStackError(); } processRateLimitedPaths();