Skip to main content

Module cron

Module cron 

Source
Expand description

Cron expression matcher — replaces the Python cron_match.py script.

Supports:

  • Standard 5-field cron expressions
  • --since TIMESTAMP mode: check if the schedule fired between a timestamp and now

This eliminates the python3 subprocess that v0 forks on every tick.

Functions§

check
Check if a cron expression matches now, or (with since) has matched at any point between since and now.
expand_alias
Expand cron alias strings (like @hourly, @daily 9:30) into standard 5-field cron expressions. Unrecognized strings are returned unchanged.
normalize_dow
Normalize day-of-week field: standard cron allows 0 for Sunday, but the cron crate only accepts 1-7 (1=Mon, 7=Sun). Replace standalone 0 with 7.