Skip to main content

Module cron

Module cron 

Source
Expand description

#3873: the Cron refinement rule — exactly Cloudflare’s cron-trigger syntax.

is_cron_expression is the one compile-time statement of the rule the Cron predicate enforces; its TypeScript twin is __bynkIsCron (bynk-emit/runtime/src/cron.ts). Where Cloudflare’s documentation does not settle a form, the rule refuses it: a refusal can be relaxed later, an admission can’t be withdrawn.

Five fields separated by exactly one space (no leading or trailing space): minute 0-59, hour 0-23, day of month 1-31 (also L, W), month 1-12 or JAN-DEC, day of week 1-7 with 1 = Sunday, or SUN-SAT (also L, #). Names are case-insensitive. No seconds, year, ? or @daily macros.

Structs§

CronFault
Why a string is not a valid cron schedule: the failing field and the reason.

Functions§

describe_fields
#3873: a valid schedule’s five fields, named, for hover: (field, text) pairs in order, e.g. [("minute", "0"), ("hour", "2"), …]. None unless the schedule is valid.
is_cron_expression
Is s a schedule Cloudflare’s cron triggers accept? Ok(()) if so, else the first failing field.
numeric_weekday
bynk.cron.numeric_weekday: the day-of-week field names a day by number. Standard cron’s 5 is Friday, but Cloudflare’s is Thursday (1 = Sunday).
uneven_step
bynk.cron.uneven_step: a */n in minute or hour where n does not divide the field’s range, with a description of when it actually fires.