mirror of
https://github.com/tiramisulabs/seyfert.git
synced 2025-07-02 04:56:07 +00:00
15 lines
530 B
TypeScript
15 lines
530 B
TypeScript
import { RestManager } from "./restManager.ts";
|
|
|
|
/** Cleans up the queues by checking if there is nothing left and removing it. */
|
|
export function cleanupQueues(rest: RestManager) {
|
|
for (const [key, queue] of rest.pathQueues) {
|
|
rest.debug(`[REST - cleanupQueues] Running for of loop. ${key}`);
|
|
if (queue.requests.length) continue;
|
|
// REMOVE IT FROM CACHE
|
|
rest.pathQueues.delete(key);
|
|
}
|
|
|
|
// NO QUEUE LEFT, DISABLE THE QUEUE
|
|
if (!rest.pathQueues.size) rest.processingQueue = false;
|
|
}
|