Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Changed: one redis connection for all workers

now that our ZPOP does not block this is all good
  • Loading branch information...
commit 307d0167928833790e84e2f954c12d2bef1ca3b8 1 parent 95cc403
@tj tj authored
Showing with 2 additions and 2 deletions.
  1. +1 −1  examples/delayed.js
  2. +1 −1  lib/queue/worker.js
View
2  examples/delayed.js
@@ -36,7 +36,7 @@ jobs.create('email', {
jobs.promote();
-jobs.process('email', 5, function(job, done){
+jobs.process('email', 10, function(job, done){
setTimeout(function(){
done();
}, Math.random() * 5000);
View
2  lib/queue/worker.js
@@ -32,7 +32,7 @@ module.exports = Worker;
function Worker(queue, type) {
this.queue = queue;
this.type = type;
- this.client = redis.createClient();
+ this.client = Worker.client || (Worker.client = redis.createClient());
this.interval = 1000;
}

0 comments on commit 307d016

Please sign in to comment.
Something went wrong with that request. Please try again.