Created by: andrewburgess
Fix delay
calculation. Previously, it would not work if queue.add
was called multiple times, since the delay would always be the interval length instead of the amount of time from now to the next call.
Add isRepeat
flag to change which iteration is calculated. Only calculate based on queue millis
when we repeat to get the next job, otherwise use the current time so the immediate next interval is used.
Not sure if the isRepeat
flag is the best way to handle this, but I think there needs to be a differentiation between calling queue.add
and adding the next repetition of the job.
Addresses #558 (closed)