MCPcopy Index your code
hub / github.com/node-schedule/node-schedule / scheduleNextRecurrence

Function scheduleNextRecurrence

lib/Invocation.js:320–337  ·  view source on GitHub ↗
(rule, job, prevDate, endDate)

Source from the content-addressed store, hash-verified

318
319/* Recurrence scheduler */
320function scheduleNextRecurrence(rule, job, prevDate, endDate) {
321
322 prevDate = (prevDate instanceof CronDate) ? prevDate : new CronDate();
323
324 const date = (rule instanceof RecurrenceRule) ? rule._nextInvocationDate(prevDate) : rule.next();
325 if (date === null) {
326 return null;
327 }
328
329 if ((endDate instanceof CronDate) && date.getTime() > endDate.getTime()) {
330 return null;
331 }
332
333 const inv = new Invocation(job, date, rule, endDate);
334 scheduleInvocation(inv);
335
336 return inv;
337}
338
339module.exports = {
340 Range,

Callers 3

JobFunction · 0.85
Job.jsFile · 0.85
prepareNextInvocationFunction · 0.85

Calls 1

scheduleInvocationFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…