services/cron/schedule
Cron schedule parsing — extracted to avoid import cycles with plugins/tools/cron. Pure parsing module with no dependencies on core/loop or sqlight.
Types
pub type CronJob {
CronJob(
alias: String,
schedule: CronSchedule,
job_type: JobType,
)
}
Constructors
-
CronJob(alias: String, schedule: CronSchedule, job_type: JobType)
pub type CurrentTime {
CurrentTime(
minute: Int,
hour: Int,
dom: Int,
month: Int,
dow: Int,
)
}
Constructors
-
CurrentTime( minute: Int, hour: Int, dom: Int, month: Int, dow: Int, )
Values
pub fn cron_matches(
schedule: CronSchedule,
now: CurrentTime,
) -> Bool
Check whether a cron schedule matches a given minute-of-week value.
pub fn parse_schedule(
expr: String,
) -> Result(CronSchedule, String)
Parse a 5-field cron expression like “0 9 * * 1-5” into a CronSchedule.