makes the next listener one-time use, to avoid memory leaks.
Signed-off-by: Hao Luo <howlowck@gmail.com>
This commit is contained in:
@@ -124,7 +124,7 @@ export class TaskWorker {
|
||||
return new Promise(resolve => {
|
||||
// "next" event emits when a task completes
|
||||
// https://github.com/sindresorhus/p-queue#next
|
||||
this.taskQueue.on('next', () => {
|
||||
this.taskQueue.once('next', () => {
|
||||
resolve();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user