Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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 Holowaychuk visionmedia authored

Showing 2 changed files with 2 additions and 2 deletions. Show diff stats Hide diff stats

  1. +1 1  examples/delayed.js
  2. +1 1  lib/queue/worker.js
2  examples/delayed.js
@@ -36,7 +36,7 @@ jobs.create('email', {
36 36
37 37 jobs.promote();
38 38
39   -jobs.process('email', 5, function(job, done){
  39 +jobs.process('email', 10, function(job, done){
40 40 setTimeout(function(){
41 41 done();
42 42 }, Math.random() * 5000);
2  lib/queue/worker.js
@@ -32,7 +32,7 @@ module.exports = Worker;
32 32 function Worker(queue, type) {
33 33 this.queue = queue;
34 34 this.type = type;
35   - this.client = redis.createClient();
  35 + this.client = Worker.client || (Worker.client = redis.createClient());
36 36 this.interval = 1000;
37 37 }
38 38

0 comments on commit 307d016

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