From f366f603442b46c66d62e0382018388d5e640190 Mon Sep 17 00:00:00 2001 From: K1 Date: Thu, 2 Jul 2015 15:03:21 +0200 Subject: [PATCH 1/2] Fix: after setting new key lock timeout in queueLock its pointless to check if is greater than timeout beacuse it will never be, so callback will always return false as second argument and then job will not be pushed to queue --- lib/plugins/queueLock.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/plugins/queueLock.js b/lib/plugins/queueLock.js index cd6c0488..aa54f316 100644 --- a/lib/plugins/queueLock.js +++ b/lib/plugins/queueLock.js @@ -32,8 +32,7 @@ queueLock.prototype.before_enqueue = function(callback){ }else{ self.worker.connection.redis.set(key, timeout, function(err){ self.worker.connection.redis.get(key, function(err, redisTimeout){ - redisTimeout = parseInt(redisTimeout); - callback(null, now > redisTimeout); + callback(err, !err); }); }); } From 898f87d6acd23dfbda15f78f850dff2bc7d77b75 Mon Sep 17 00:00:00 2001 From: K1 Date: Fri, 24 Jul 2015 12:48:44 +0200 Subject: [PATCH 2/2] remove pointless reading from redis --- lib/plugins/queueLock.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/plugins/queueLock.js b/lib/plugins/queueLock.js index aa54f316..7da76daf 100644 --- a/lib/plugins/queueLock.js +++ b/lib/plugins/queueLock.js @@ -31,9 +31,7 @@ queueLock.prototype.before_enqueue = function(callback){ callback(null, false); }else{ self.worker.connection.redis.set(key, timeout, function(err){ - self.worker.connection.redis.get(key, function(err, redisTimeout){ - callback(err, !err); - }); + callback(err, !err); }); } });