runSchedules
Purpose and behavior
Section titled “Purpose and behavior”Publish one trigger job per cron slot of each schedule until signal aborts, then resolve. Each slot enqueues schedule:<name>:<slot ISO time>, so replicas and restarts sharing a queue converge on one job; after startup or a delay, only the latest slot within maxLateMs is published. Invalid options reject, and without onError the first publication failure stops every schedule and rejects.
Complete example and detailed rules.
Parameters and properties
Section titled “Parameters and properties”optionsRequiredRunSchedulesOptionsQueue, schedules, stop signal and lateness policy.options.queueRequiredTaskQueueQueue receiving one trigger job per slot; share it between scheduler replicas so they converge on the same job.options.schedulesRequiredreadonly TriggerSchedule[]At least one schedule, each with a unique name.options.signalRequiredAbortSignalStops every schedule; runSchedules() then resolves.options.maxLateMsOptionalnumber | undefinedMaximum delay after a slot for it to still be published, including at startup; defaults to 60000. Only the latest slot within this window is published; a negative or non-integer value rejects.options.onErrorOptional((error: unknown, failure: ScheduleFailure) => void) | undefinedReceives each publication failure with its schedule and slot, and scheduling continues; without it the first failure stops every schedule and rejects runSchedules(). Errors thrown by the callback are ignored.