diff --git a/lib/outputs/output_amqp.js b/lib/outputs/output_amqp.js index e24fa085..3510d3c6 100644 --- a/lib/outputs/output_amqp.js +++ b/lib/outputs/output_amqp.js @@ -119,11 +119,11 @@ OutputAmqp.prototype.publish = function(message,options){ OutputAmqp.prototype.reconnect = function() { let self = this; - setTimeout(()=>{ + self.reconnectTimeoutId = setTimeout(() => { self.connect().then(() => { - clearTimeout(self.reconnect); + clearTimeout(self.reconnectTimeoutId); }).catch((err) => console.error(err)); - },self.retry_delay); + }, self.retry_delay); }; OutputAmqp.prototype.connect = function(){