Documentation
¶
Index ¶
Constants ¶
const ActiveTriggerCount = 4
ActiveTriggerCount is the number of cron triggers actually scheduled. The 5th slot is calculated but not deployed (overnight gap).
Variables ¶
This section is empty.
Functions ¶
func Calculate ¶
Calculate returns 5 time slots at 5-hour intervals starting from startTime. startTime must be in "HH:MM" 24-hour format.
func DetectTimezone ¶
func DetectTimezone() string
func GetNextTrigger ¶
GetNextTrigger returns the next upcoming trigger as a time.Time and a human-readable label. Uses only the first ActiveTriggerCount slots.
func GetResetTime ¶
GetResetTime returns the time 5 hours after triggerTime. triggerTime must be in "HH:MM" 24-hour format.
func ToCron ¶
ToCron converts local times + timezone to a UTC cron expression. Only the first ActiveTriggerCount slots are included. Returns format: "M H1,H2,H3,H4 * * *"
Known limitation: uses a single UTC offset snapshot from time.Now(). For DST-observing timezones, the baked-in offset becomes stale after a DST transition (±1 hour). Cloudflare Workers cron API does not support CRON_TZ, so there is no server-side fix. Users should run `tokfresh update` after a DST change, or choose a non-DST timezone (e.g., UTC).
Types ¶
This section is empty.