fix(socket): Prevent crashes from timeouts and fix memory leak (#1627)

This commit is contained in:
João Lucas de Oliveira Lopes
2025-09-07 08:11:32 -03:00
committed by GitHub
parent d878f01efb
commit 0fbce52fd3
2 changed files with 51 additions and 15 deletions
+5
View File
@@ -5,6 +5,11 @@ interface QueueJob<T> {
}
const _queueAsyncBuckets = new Map<string | number, Array<QueueJob<any>>>()
export function cleanupQueues() {
_queueAsyncBuckets.clear()
}
const _gcLimit = 10000
async function _asyncQueueExecutor(queue: Array<QueueJob<any>>, cleanup: () => void): Promise<void> {