Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

…elay"

This reverts commit c75b044.
  • Loading branch information...
commit 9af10b9e62ac7f2eaadd3a4a1b2245eaa9506cb0 1 parent 30ae7ae
@tj tj authored
Showing with 5 additions and 11 deletions.
  1. +5 −11 lib/queue/worker.js
View
16 lib/queue/worker.js
@@ -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);
});
};
Please sign in to comment.
Something went wrong with that request. Please try again.