Features
- Distributed run coordination — opt-in
distributed: trueruns a task on a single instance per fire across a fleet (the #477 use case). Ships a built-inNODE_CRON_RUNenv-var default (one designated runner, no dependencies) and a pluggableRunCoordinator(viasetRunCoordinator, or the per-taskrunCoordinatoroption) for high-availability, per-fire coordination (e.g. a Redis lock). Adds thedistributedTtloption and anexecution:skippedevent carrying areason('not-elected'|'coordinator-error'). Works for inline and background tasks. (#549, closes #477) - Task introspection on
ScheduledTask:getNextRuns(n)(preview the next N run times),match(date),msToNext(),isBusy(),runsLeft()andgetPattern(). (#547) cron.parse(expression)andcron.validateDetailed(expression)— decompose an expression into its fields, or get every field-level problem (without throwing) for tooling and richer error messages. (#548)
Fixes
getNextMatchno longer scans every time of day on a day that matches the day-of-month but not the weekday. A dense expression constrained by both (e.g.* * * 15 * 1) could take minutes to resolve; it is now instant. (#542)
Internal
- Cleanups with no public API change: fixed the
milisecond→millisecondspelling and theconvertion/→conversion/directory name. (#543)
Docs
- New Distributed Coordination guide, plus pages for task introspection and
parse/validateDetailed, at nodecron.com.
Full Changelog: v4.3.0...v4.4.0