Function: nextOccurrence()
function nextOccurrence(schedule, from): number;
Defined in: packages/client/src/core/job-engine/schedule.ts:134
The first moment this schedule comes due strictly after from.
The occurrences between the last run and from are not returned, and there is no
way to ask for them. That absence is the design: a device that was closed for a
fortnight has missed fourteen occurrences of a daily job, and replaying them would run
the campaign fourteen times over data that only justifies running it once. A sweep
that reads current state does the right thing in a single pass; fourteen sweeps do the
same thing plus a stampede.
Parameters
| Parameter | Type | Description |
|---|---|---|
schedule | ParsedSchedule | A parsed schedule. |
from | number | The instant to measure from, normally "now". |
Returns
number
The next due timestamp, strictly greater than from.