From 3abeeeabf440c5612e7c74366ba6095a811e21cc Mon Sep 17 00:00:00 2001 From: Thomas Date: Mon, 30 Dec 2019 14:30:15 +0100 Subject: [PATCH] Expose Queue's nextMillis method --- lib/repeatable.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/repeatable.js b/lib/repeatable.js index 9f1cb576b..c1a336453 100644 --- a/lib/repeatable.js +++ b/lib/repeatable.js @@ -30,7 +30,7 @@ module.exports = function(Queue) { let now = Date.now(); now = prevMillis < now ? now : prevMillis; - const nextMillis = getNextMillis(now, repeat); + const nextMillis = this.getNextMillis(now, repeat); if (nextMillis) { const jobId = repeat.jobId ? repeat.jobId + ':' : ':'; const repeatJobKey = getRepeatKey(name, repeat, jobId); @@ -184,7 +184,7 @@ module.exports = function(Queue) { return name + ':' + jobId + endDate + suffix; } - function getNextMillis(millis, opts) { + Queue.prototype.getNextMillis = function(millis, opts) { if (opts.cron && opts.every) { throw new Error( 'Both .cron and .every options are defined for this repeatable job'