Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v0.1.6] HttpException causes the destroyAll method of queue to throw error #3

Closed
stitchng opened this issue Jun 25, 2019 · 2 comments
Labels
bug Something isn't working

Comments

@stitchng
Copy link
Owner

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)
    }
  }
@stitchng stitchng added the bug Something isn't working label Jun 25, 2019
@stitchng stitchng changed the title [Bug] HttpException cause the destroyAll method of Queue to throw error [v0.1.6] HttpException cause the destroyAll method of Queue to throw error Jun 25, 2019
@stitchng stitchng changed the title [v0.1.6] HttpException cause the destroyAll method of Queue to throw error [v0.1.6] HttpException causes the destroyAll method of queue to throw error Jun 25, 2019
@stitchng
Copy link
Owner Author

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)
         }
     }
  }

@stitchng
Copy link
Owner Author

This was fixed in a release (v0.1.6) today on npm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant