Skip to content

feat: first-class CRON scheduling in the nodehost - #415

Open
scroix wants to merge 2 commits into
museumsvictoria:devfrom
scroix:feature/cron-scheduling
Open

feat: first-class CRON scheduling in the nodehost#415
scroix wants to merge 2 commits into
museumsvictoria:devfrom
scroix:feature/cron-scheduling

Conversation

@scroix

@scroix scroix commented Jul 22, 2026

Copy link
Copy Markdown
Member

Implements #411 and restores the format: "cron" editor that went missing in the 2.2.x UI rewrite (#196). The companion Scheduler recipe is tracked in museumsvictoria/nodel-recipes#108.

The host now owns CRON parsing, validation, descriptions and execution-time calculation in one place (org.nodel.cron.CronExpressions, built on cron-utils). Expressions are standard five-field UNIX cron with named weekdays and months, and Sunday accepted as 0 or 7. Schedules run in the host timezone unless given an IANA timezone. The semantics are pinned by tests: occurrences that fall in a daylight-saving gap are skipped, an overlap fires once at the first pass, a fire that arrives late (system suspend, heavy load) happens once with the missed occurrences coalesced into it, and after a restart a schedule looks forward only.

Recipes get a Cron class alongside Timer with the same lifecycle (starts after main(), torn down on script restart), plus cron_validate, cron_describe, cron_next and cron_previous helpers. ManagedCron self-reschedules one-off tasks on the shared Timers pool, so there is no per-schedule thread and no OS scheduler involved.

Every node answers REST/cron?expression=...&timezone=... with validity, the failure reason, a readable description and previous/next/upcoming execution times. The web UI renders format: "cron" fields as a text input with live, host-backed feedback that also populates for saved values at load; since this ships in the shared v1 bundle, Frontend/Mk2-style dashboards get the same editor with no per-node code.

cron-utils 9.2.1 arrives with its slf4j-api 2.x dependency excluded: the host ships a 1.7-style binding that the 2.x API ignores, so letting it in would silently disable logging. cron-utils only calls 1.7-era logger methods, so it runs safely against the pinned 1.7.10 API.

Note

The params editor previews execution times in the host timezone. A per-schedule timezone preview needs data-timezone on the input, which only hand-written dashboards can set for now.

scroix added 2 commits July 16, 2026 10:48
Managed Cron schedules on the shared timer infrastructure (cron-utils
9.2.1 with its slf4j-api 2.x excluded), a recipe-facing Cron API
alongside Timer, per-node REST/cron support, and the restored
format:"cron" editor in the shared web UI.

Implements museumsvictoria#411; restores the editor from
museumsvictoria#196.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant