Skip to content

Commit

Permalink
Merge pull request #335 from urossmolnik/amqp_unreturned_promise
Browse files Browse the repository at this point in the history
Fix a warning of unreturned Promise in amqp transport connect code
  • Loading branch information
icebob committed Jul 20, 2018
2 parents 44cf56a + 3afa39c commit 6e64a20
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/transporters/amqp.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ class AmqpTransporter extends Transporter {
.createChannel()
.then((channel) => {
this.channel = channel;
this.onConnected().then(resolve);
this.logger.info("AMQP channel is created.");

channel.prefetch(this.opts.prefetch);
Expand All @@ -157,7 +156,10 @@ class AmqpTransporter extends Transporter {
.on("return", (msg) => {
this.logger.warn("AMQP channel returned a message.", msg);
});

return this.onConnected();
})
.then(resolve)
.catch((err) => {
/* istanbul ignore next*/
this.logger.error("AMQP failed to create channel.");
Expand Down

0 comments on commit 6e64a20

Please sign in to comment.