node-resque
Advanced tools
Comparing version 0.3.2 to 0.3.3
@@ -86,7 +86,3 @@ // If a job with the same name, queue, and args is already in the queue, do not enqueue it again | ||
}else{ | ||
try{ | ||
var flattenedArgs = self.args.join("-"); | ||
}catch(e){ | ||
var flattenedArgs = JSON.stringify(self.args); | ||
} | ||
var flattenedArgs = JSON.stringify(self.args); | ||
return self.worker.connection.key('lock', self.func, self.queue, flattenedArgs); | ||
@@ -93,0 +89,0 @@ } |
@@ -126,7 +126,8 @@ var os = require("os"); | ||
d.run(function(){ | ||
try{ | ||
if (self.jobs[job["class"]] == null){ throw new Error("No job defined for class '"+job["class"]+"'") } | ||
if (self.jobs[job["class"]] == null){ | ||
throw new Error("No job defined for class '"+job["class"]+"'") | ||
}else{ | ||
var cb = self.jobs[job["class"]]["perform"]; | ||
self.emit('job', self.queue, job); | ||
if (cb != null) { | ||
if(cb != null) { | ||
self.working = true; | ||
@@ -151,7 +152,5 @@ self.job = job; | ||
}); | ||
} else { | ||
self.completeJob(null, new Error("Missing Job: " + job["class"]), callback); | ||
}else{ | ||
self.completeJob(new Error("Missing Job: " + job["class"]), null, callback); | ||
} | ||
}catch(err){ | ||
d.emit('error', err); | ||
} | ||
@@ -168,3 +167,3 @@ }); | ||
self.fail(err, job); | ||
}else if(result != null){ | ||
}else{ | ||
self.succeed(result, job); | ||
@@ -171,0 +170,0 @@ } |
@@ -5,3 +5,3 @@ { | ||
"description": "an opinionated implementation of resque in node", | ||
"version": "0.3.2", | ||
"version": "0.3.3", | ||
"homepage": "http://github.com/taskrabbit/node-resque", | ||
@@ -25,4 +25,4 @@ "repository": { | ||
"scripts": { | ||
"test": "./node_modules/.bin/mocha --reporter spec" | ||
"test": "mocha" | ||
} | ||
} |
@@ -35,11 +35,13 @@ var redis = require('redis'); | ||
var self = this; | ||
self.redis.keys(self.namespace + "*", function(err, keys){ | ||
if(keys.length == 0){ | ||
callback(); | ||
}else{ | ||
self.redis.del(keys, function(){ | ||
callback(); | ||
}); | ||
} | ||
}); | ||
setTimeout(function(){ | ||
self.redis.keys(self.namespace + "*", function(err, keys){ | ||
if(keys.length == 0){ | ||
callback(); | ||
}else{ | ||
self.redis.del(keys, function(){ | ||
callback(); | ||
}); | ||
} | ||
}); | ||
}, 200); | ||
}, | ||
@@ -46,0 +48,0 @@ startAll: function(jobs, callback){ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
72183
30
1872
25