Permalink
Browse files

Revert "If a job with a delay has more attempts, honor the original d…

…elay"

This reverts commit c75b044.
  • Loading branch information...
1 parent 30ae7ae commit 9af10b9e62ac7f2eaadd3a4a1b2245eaa9506cb0 @tj tj committed Nov 8, 2012
Showing with 5 additions and 11 deletions.
  1. +5 −11 lib/queue/worker.js
View
@@ -85,8 +85,8 @@ Worker.prototype.error = function(err, job){
/**
* Process a failed `job`. Set's the job's state
* to "failed" unless more attempts remain, in which
- * case the job is marked as "inactive" or "delayed"
- * and remains in the queue.
+ * case the job is marked as "inactive" and remains
+ * in the queue.
*
* @param {Function} fn
* @return {Worker} for chaining
@@ -100,15 +100,9 @@ Worker.prototype.failed = function(job, err, fn){
self.error(err, job);
job.attempt(function(error, remaining, attempts, max){
if (error) return self.error(error, job);
- if (remaining) {
- if (job.delay()) {
- job.delay(job.delay());
- } else {
- job.inactive();
- }
- } else {
- job.failed();
- }
+ remaining
+ ? job.inactive()
+ : job.failed();
self.start(fn);
});
};

0 comments on commit 9af10b9

Please sign in to comment.