|
|
|
@ -198,7 +198,7 @@ module.exports = function createTaskQueue(options) {
|
|
|
|
|
} else {
|
|
|
|
|
debugLoop(`Returning awaitDrained Promise for '${type}'`);
|
|
|
|
|
return new Promise((resolve, reject) => {
|
|
|
|
|
this.on(`queueDrained:${type}`, () => {
|
|
|
|
|
this.once(`queueDrained:${type}`, () => {
|
|
|
|
|
debugLoop(`Resolving awaitDrained Promise for '${type}'`);
|
|
|
|
|
resolve();
|
|
|
|
|
})
|
|
|
|
@ -220,7 +220,7 @@ module.exports = function createTaskQueue(options) {
|
|
|
|
|
} else {
|
|
|
|
|
debugLoop(`Returning awaitCompleted Promise for '${type}'`);
|
|
|
|
|
return new Promise((resolve, reject) => {
|
|
|
|
|
this.on(`queueCompleted:${type}`, () => {
|
|
|
|
|
this.once(`queueCompleted:${type}`, () => {
|
|
|
|
|
debugLoop(`Resolving awaitCompleted Promise for '${type}'`);
|
|
|
|
|
resolve();
|
|
|
|
|
})
|
|
|
|
|