node-resque
node-resque copied to clipboard
Queue constructor callback runs twice
When supplying a redis client object as the connection details for a new queue, the callback defined as the third parameter of the queue is called twice.
var resque = require('node-resque');
var redis = require('redis').createClient(6379, '127.0.0.1');
var queue = new resque.queue({
connection: { redis: redis },
}, {}, function () {
console.log('CALLBACK');
});
// output:
// CALLBACK
// CALLBACK
Tested with: [email protected] and [email protected] [email protected]
Thanks! I had assumed that if you were passing a previously-generated redis connection, it would have already been connected.
This will solve it https://github.com/taskrabbit/node-resque/commit/f04a1eb421e7888f0b94bd68562ce60673198837