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 } };