amqplib-auto-recovery
Advanced tools
Comparing version 0.1.0 to 0.2.0
{ | ||
"name": "amqplib-auto-recovery", | ||
"description": "Automatic connection recovery for amqplib", | ||
"version": "0.1.0", | ||
"version": "0.2.0", | ||
"author": "Stanley Shyiko <stanley.shyiko@gmail.com>", | ||
@@ -6,0 +6,0 @@ "license": "MIT", |
@@ -66,2 +66,2 @@ # amqplib-auto-recovery | ||
[MIT License](https://github.com/shyiko/amqplib-auto-recovery/blob/master/mit.license) | ||
[MIT License](https://opensource.org/licenses/MIT) |
@@ -24,6 +24,6 @@ const backoff = require('backoff'); | ||
connect: { | ||
value: function connect(url, connectCallback) { | ||
value: function connect(url, opts, connectCallback) { | ||
let activeConnection = null; | ||
const spec = backoff.call((cb) => { | ||
amqp.connect(url, (err, con) => { | ||
amqp.connect(url, opts, (err, con) => { | ||
if (err) { | ||
@@ -83,3 +83,3 @@ connectCallback(err); | ||
channelClosed = true; | ||
// do not close the connection is channel was deliberately | ||
// do not close the connection if channel was deliberately | ||
// closed by the client | ||
@@ -86,0 +86,0 @@ channelClosedByClient || closeConnection(); |
8349