- Something that handles schedules, which queues each due job.
- A runner that runs the schedule’s queue.
--handle-schedules and --all-queues does both.
Add a schedule
Addschedule to a task or workflow:
cron and queue.
Handle schedules
Use one of these, covering the schedule’s queue:
Handle schedules often, every minute or faster. The cron decides when a job runs; the handling interval only needs to be shorter than the gap between occurrences.
Run schedule handling in one place, such as a single scheduler process. If web replicas also autorun, see Disable web autorun.
How scheduling works
Each time schedules are handled, for every schedule in the selected queues, FrogBot:- Works out the next cron time after the schedule last queued a job. It keeps that time in the
payload-jobs-statsglobal. - Calls
beforeSchedule. By default, it skips while a scheduled job of the same task or workflow in that queue is still unfinished, so runs don’t pile up or overlap. - Queues the job with
waitUntilset to that cron time andmeta: { scheduled: true }. The job is queued ahead of time and waits until then. - Calls
afterSchedule, which by default records the time inpayload-jobs-stats.
TZ on the process to pin it.
Cron format
Use five fields, or six with a leading seconds field:Set the input of a scheduled job
Scheduled jobs get{} as input. To compute input when the job is queued, wrap the default check in beforeSchedule:
shouldSchedule and waitUntil. Without waitUntil, the job runs as soon as a runner sees it, not at the cron time. A hook that always returns shouldSchedule: true queues another job on every scheduling tick.