From 10a9eae35abb7ac8af952182409db3f83b9ff474 Mon Sep 17 00:00:00 2001 From: Harris Munir Date: Tue, 21 Apr 2020 23:16:38 -0700 Subject: [PATCH] fix: clamp negative job delay values to 0 to prevent thrashing --- lib/job.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/job.js b/lib/job.js index 1e02cac2c..fd2870642 100644 --- a/lib/job.js +++ b/lib/job.js @@ -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;