amqp-connection-manager
Advanced tools
Comparing version 1.3.3 to 1.3.4
@@ -85,5 +85,6 @@ // Generated by CoffeeScript 1.10.0 | ||
AmqpConnectionManager.prototype._connect = function() { | ||
if (this._closed) { | ||
if (this._closed || this._connecting || this.isConnected()) { | ||
return Promise.resolve(); | ||
} | ||
this._connecting = true; | ||
return Promise.resolve().then((function(_this) { | ||
@@ -119,7 +120,11 @@ return function() { | ||
connection.on('error', function(err) { | ||
_this._currentConnection = null; | ||
_this.emit('disconnect', { | ||
err: err | ||
}); | ||
return _this._connect()["catch"](function(err) { | ||
return Promise.resolve().then(function() { | ||
return this._currentConnection.close(); | ||
})["catch"](function(err) {}).then(function() { | ||
_this._currentConnection = null; | ||
_this.emit('disconnect', { | ||
err: err | ||
}); | ||
return _this._connect(); | ||
})["catch"](function(err) { | ||
@@ -136,2 +141,3 @@ /* !pragma coverage-skip-block */ | ||
}); | ||
_this._connecting = false; | ||
_this.emit('connect', { | ||
@@ -151,2 +157,3 @@ connection: connection, | ||
return wait(_this.reconnectTimeInSeconds * 1000).then(function() { | ||
_this._connecting = false; | ||
return _this._connect(); | ||
@@ -153,0 +160,0 @@ }); |
{ | ||
"name": "amqp-connection-manager", | ||
"version": "1.3.3", | ||
"version": "1.3.4", | ||
"description": "Auto-reconnect and round robin support for amqplib.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
27002
436