Overview
RepeatableOptions (also exported as RepeatOptions) defines configuration for jobs that repeat at specified intervals.For new implementations, use
queue.upsertJobScheduler() instead of the deprecated repeat option on jobs.Interface
Properties
pattern
Cron pattern for scheduling (e.g., ‘0 * * * *’ for every hour)
every
Interval in milliseconds between job executions
Use either
pattern or every, not both.limit
Maximum number of iterations to execute
startDate
Timestamp when the repeat should start
endDate
Timestamp when the repeat should end
tz
Timezone for cron patterns (e.g., ‘America/New_York’)
offset
Offset in milliseconds to apply to the calculated next run time
immediately
If true, runs the job immediately then schedules repeats
Examples
Cron Pattern
Fixed Interval
With Timezone
Limited Iterations
With Start and End Dates
Run Immediately
With Offset
Cron Pattern Format
Cron patterns use the following format:Common Patterns
Timezone Support
Timezones use IANA timezone identifiers:Migration from Deprecated API
Old (Deprecated)
New (Recommended)
Related
- JobScheduler - Manages scheduled repeating jobs
- RepeatOptions on MDN - Underlying cron library
