Comparing version 0.10.1 to 0.10.2
@@ -16,3 +16,2 @@ 'use strict' | ||
ctx.connection = connection | ||
ctx.connection.setMaxListeners(0) | ||
@@ -19,0 +18,0 @@ /* |
@@ -34,3 +34,2 @@ var debug = require('debug')('rascal:Vhost') | ||
self.emit('connect') | ||
// TODO its possible a connection error has already triggered an init cycle, so may need to disconnect again | ||
ctx.connection.removeAllListeners('error') | ||
@@ -102,2 +101,3 @@ ctx.connection.once('error', handleConnectionError.bind(null, config)) | ||
if (err) return next(err) | ||
channel.connection.setMaxListeners(0); | ||
next(null, channel) | ||
@@ -104,0 +104,0 @@ } |
{ | ||
"name": "rascal", | ||
"version": "0.10.1", | ||
"version": "0.10.2", | ||
"description": "A friendly wrapper around amqplib with (mostly) safe defaults", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -1235,2 +1235,33 @@ var assert = require('assert') | ||
it('should not warn about emitter leaks', function(done) { | ||
var config = { | ||
vhosts: vhosts, | ||
publications: publications, | ||
subscriptions: {} | ||
} | ||
_.times(11, function(i) { | ||
config.subscriptions['s' + i] = { | ||
vhost: '/', | ||
queue: 'q1', | ||
options: { | ||
noAck: true | ||
} | ||
} | ||
}) | ||
createBroker(config, function(err, broker) { | ||
assert.ifError(err) | ||
_.times(11, function(i) { | ||
broker.subscribe('s' + i, function(err, subscription) { | ||
assert.ifError(err) | ||
if (i === 10) done() | ||
}) | ||
}) | ||
}) | ||
}) | ||
function createBroker(config, next) { | ||
@@ -1237,0 +1268,0 @@ config = _.defaultsDeep(config, testConfig) |
247331
5361