Skip to content

Commit

Permalink
fix: clamp negative job delay values to 0 to prevent thrashing
Browse files Browse the repository at this point in the history
  • Loading branch information
harris-m authored and manast committed Apr 23, 2020
1 parent c06af98 commit 10a9eae
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/job.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const Job = function(queue, name, data, opts) {
this.queue = queue;
this.data = data;
this._progress = 0;
this.delay = this.opts.delay;
this.delay = this.opts.delay < 0 ? 0 : this.opts.delay;
this.timestamp = this.opts.timestamp;
this.stacktrace = [];
this.returnvalue = null;
Expand Down

0 comments on commit 10a9eae

Please sign in to comment.