Skip to content

Commit

Permalink
fixup retry plugin when there is no error
Browse files Browse the repository at this point in the history
  • Loading branch information
evantahler committed Mar 16, 2016
1 parent 6913f51 commit 8bebb5e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
7 changes: 3 additions & 4 deletions examples/retry.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,8 @@ var jobs = {
},
},
perform: function(a,b,callback){
var broken = true;

if(broken){
return callback(new Error('BUSTED'));
if(a < 0){
return callback(new Error('NEGATIVE NUMBERS ARE HARD :('));
}else{
return callback(null, (a + b));
}
Expand Down Expand Up @@ -99,4 +97,5 @@ var queue = new NR.queue({connection: connectionDetails}, jobs);
queue.on('error', function(error){ console.log(error); });
queue.connect(function(){
queue.enqueue('math', "add", [1,2]);
queue.enqueue('math', "add", [-1,2]);
});
2 changes: 1 addition & 1 deletion lib/plugins/retry.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ retry.prototype.after_perform = function(callback){
var self = this;

if(!self.worker.error){
self.cleanup(callback);
return self.cleanup(callback);
}

self.attemptUp(function(error, remaning){
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "node-resque",
"description": "an opinionated implementation of resque in node",
"license": "Apache-2.0",
"version": "2.0.1",
"version": "2.0.2",
"homepage": "http://github.com/taskrabbit/node-resque",
"repository": {
"type": "git",
Expand Down

0 comments on commit 8bebb5e

Please sign in to comment.