Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: Automattic/kue
base: master
...
head fork: 3rd-Eden/kue
compare: master
Checking mergeability… Don't worry, you can still create the pull request.
  • 1 commit
  • 1 file changed
  • 0 commit comments
  • 1 contributor
Showing with 9 additions and 3 deletions.
  1. +9 −3 lib/queue/worker.js
View
12 lib/queue/worker.js
@@ -89,14 +89,20 @@ Worker.prototype.error = function(err, job){
Worker.prototype.failed = function(job, err, fn){
var self = this;
+
events.emit(job.id, 'failed');
job.failed().error(err);
self.error(err, job);
+
job.attempt(function(error, remaining, attempts, max){
if (error) return self.error(error, job);
- remaining
- ? job.inactive()
- : job.failed();
+
+ if (!remaining) {
+ job.failed();
+ } else if (job._state !== 'delayed') {
+ job.inactive();
+ }
+
self.start(fn);
});
};

No commit comments for this range

Something went wrong with that request. Please try again.