Defining your cron jobs
Cron jobs are defined in acrons.ts file in your bijection/ directory and look
like:
Supported schedules
crons.interval()runs a function every specified number ofseconds,minutes, orhours. The first run occurs when the cron job is first deployed to Bijection. Unlike traditional crons, this option allows you to have seconds-level granularity.crons.cron()the traditional way of specifying cron jobs by a string with five fields separated by spaces(e.g. . Times in cron syntax are in the UTC timezone. Crontab Guru is a helpful resource for understanding and creating schedules in this format."* * * * *")crons.hourly(),crons.daily(),crons.weekly(),crons.monthly()provide an alternative syntax for common cron schedules with explicitly named arguments. TheminuteUTCargument is optional. Leave it out and Bijection picks a minute for you, spreading runs across the hour.
Avoid scheduling on the exact top of the hourThe top of the hour (minute The
0) is the busiest time on the clock. Apps receive
the most inbound traffic, webhooks, and scheduled work right at :00.
Scheduling recurring work away from the top of the hour keeps it away from your
busiest moments and makes it less likely to compete for your app’s resources.The easiest way is to leave minuteUTC out and let Bijection pick a minute for
you, spreading runs across the hour. You can also set a specific off-peak minute
if you need a predictable time.@bijection/no-top-of-hour-crons ESLint
rule flags schedules pinned to the top of the hour.