From cb15b1ebf2c6013c90c29726b4fea5fd37b14b98 Mon Sep 17 00:00:00 2001 From: Arkadiy Kukarkin Date: Mon, 2 Nov 2015 11:43:50 -0500 Subject: [PATCH] Fix attempts remaining logic --- lib/queue/job.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/queue/job.js b/lib/queue/job.js index 8c2644e8..bdcc4a3c 100644 --- a/lib/queue/job.js +++ b/lib/queue/job.js @@ -309,7 +309,7 @@ Job.prototype.toJSON = function() { , ttl: this._ttl , attempts: { made: Number(this._attempts) || 0 - , remaining: this._attempts ? this._max_attempts - this._attempts : Number(this._max_attempts) || 1 + , remaining: this._attempts > 0 ? this._max_attempts - this._attempts : Number(this._max_attempts) || 1 , max: Number(this._max_attempts) || 1 } };