[v0.1.6] HttpException causes the destroyAll method of queue to throw error
stitchng opened this issue · comments
Package version
v0.1.5
Node.js and npm version
v10 - NodeJS
v6 - NPM
Actual Code (that causes the issue)
Line 165 , Col 28 (src/Queue/index.js)
async destroyAll () {
// See: https://stackoverflow.com/questions/44410119/in-javascript-does-using-await-inside-a-loop-block-the-loop/44410481
for (let queue of this._queuesPool) { // TypeError: this.queuesPool is not iterable
await this.close(queue)
await this.destroy(queue)
}
}
fixing this entails changing the above code to:
From line 165, Col 28 (src/Queue/index.js)
async destroyAll () {
// See: https://stackoverflow.com/questions/44410119/in-javascript-does-using-await-inside-a-loop-block-the-loop/44410481
for (let queueName in this._queuesPool) {
if(this._queuesPool.hasOwnProperty(queueName)){
let queue = this._queuesPool[queueName];
await this.close(queue)
await this.destroy(queue)
}
}
}