Update apps/backend/scripts/run-cron-jobs.ts

Co-authored-by: Konsti Wohlwend <n2d4xc@gmail.com>
This commit is contained in:
aadesh18 2025-12-01 01:39:35 -05:00 committed by GitHub
parent 3f2a8efcfb
commit dcda40246f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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);
}
});
}
}