Skip to content

Commit

Permalink
refactor: immediately flag use once and not saved to redis
Browse files Browse the repository at this point in the history
  • Loading branch information
HugoPoi committed Nov 16, 2019
1 parent 1fc2b67 commit ae0e227
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/repeatable.js
Expand Up @@ -31,6 +31,7 @@ module.exports = function(Queue) {
now = prevMillis < now ? now : prevMillis;

const nextMillis = getNextMillis(now, repeat);
delete repeat.immediately;
if (nextMillis) {
const jobId = repeat.jobId ? repeat.jobId + ':' : ':';
const repeatJobKey = getRepeatKey(name, repeat, jobId);
Expand Down Expand Up @@ -58,9 +59,7 @@ module.exports = function(Queue) {
_.defaultsDeep(
{
repeat: {
count: currentCount,
// Do NOT save immediately flag to true
immediately: false
count: currentCount
},
jobId: customId,
delay: delay < 0 ? 0 : delay,
Expand Down

0 comments on commit ae0e227

Please sign in to comment.