noodlefrenzy / node-amqp10

amqp10 is a promise-based, AMQP 1.0 compliant node.js client
MIT License
134 stars 56 forks source link

Update amqp_client.js with guard around reconnect #345

Closed siraajahmed closed 2 years ago

siraajahmed commented 6 years ago

Stops the client attempting to reconnect when the client has been disconnected on purpose.

When disconnect has been called, _preventReconnect() gets called which sets _reconnect = null. This guard has been added to stop the client from attempting to reconnect which will end with an error from _attemptReconnection() with regards to return self._reconnect() -- self._reconnect is not a function -- because it has been set to null


This change is Reviewable

pierreca commented 6 years ago

@siraajahmed I'd like to see a test to validate this case - is it something you could add to this PR?

siraajahmed commented 6 years ago

@pierreca sure will add one

siraajahmed commented 2 years ago

Not going to have time