feat: first-class CRON scheduling in the nodehost - #415
Open
scroix wants to merge 2 commits into
Open
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
Cronclass alongsideTimerwith the same lifecycle (starts aftermain(), torn down on script restart), pluscron_validate,cron_describe,cron_nextandcron_previoushelpers.ManagedCronself-reschedules one-off tasks on the sharedTimerspool, 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 rendersformat: "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-timezoneon the input, which only hand-written dashboards can set for now.