LearnBoost/kue — pull request #215 by rosskukulinski (2013-07-08 21:28:39+00:00)
Title: Fix attempts.made and attempts.remaining from being undefined & NaN on first attempt

After the first run of a Job, the internal variable Job._attempts is still undefined. The toJSON() function includes the attempts object which references this._attempts and does math based on it. This results in invalid information being returned (namely, attempts is undefined and remaining is NaN).

This two line change will return 0 for attempts.made if _attempts is undefined, and will return max_attempts for attempts.remaining.