node-resque icon indicating copy to clipboard operation
node-resque copied to clipboard

Queue constructor callback runs twice

Open mderoche opened this issue 12 years ago • 1 comments

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]

mderoche avatar Aug 19 '14 19:08 mderoche

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

evantahler avatar Aug 19 '14 22:08 evantahler