diff --git a/apps/backend/scripts/run-cron-jobs.ts b/apps/backend/scripts/run-cron-jobs.ts index 49dbd2c4f..cebc0da17 100644 --- a/apps/backend/scripts/run-cron-jobs.ts +++ b/apps/backend/scripts/run-cron-jobs.ts @@ -23,9 +23,13 @@ async function main() { }); for (const endpoint of endpoints) { - setInterval(() => { - run(endpoint); - }, 60000); + runAsynchronously(async () => { + while (true) { + run(endpoint); + // Vercel only guarantees minute-granularity for cron jobs, so we randomize the interval + await wait(Math.random() * 120_000); + } + }); } }