Skip to content

Commit

Permalink
Changed: one redis connection for all workers
Browse files Browse the repository at this point in the history
now that our ZPOP does not block this is all good
  • Loading branch information
tj committed Aug 16, 2011
1 parent 95cc403 commit 307d016
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion examples/delayed.js
Expand Up @@ -36,7 +36,7 @@ jobs.create('email', {


jobs.promote(); jobs.promote();


jobs.process('email', 5, function(job, done){ jobs.process('email', 10, function(job, done){
setTimeout(function(){ setTimeout(function(){
done(); done();
}, Math.random() * 5000); }, Math.random() * 5000);
Expand Down
2 changes: 1 addition & 1 deletion lib/queue/worker.js
Expand Up @@ -32,7 +32,7 @@ module.exports = Worker;
function Worker(queue, type) { function Worker(queue, type) {
this.queue = queue; this.queue = queue;
this.type = type; this.type = type;
this.client = redis.createClient(); this.client = Worker.client || (Worker.client = redis.createClient());
this.interval = 1000; this.interval = 1000;
} }


Expand Down

0 comments on commit 307d016

Please sign in to comment.