Skip to content

Commit

Permalink
Let the event loop to free resources before starting again
Browse files Browse the repository at this point in the history
  • Loading branch information
yurynix committed Jun 13, 2023
1 parent a26dbeb commit 3a0a6fd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/pool.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,9 @@ class WorkerNodes extends EventEmitter {

this.workersQueue.remove(worker);

if (this.canStartWorker()) this.startWorker();
setImmediate(() => {
if (this.canStartWorker()) this.startWorker();
});

this.processQueue();
}
Expand Down

0 comments on commit 3a0a6fd

Please sign in to comment.