mirror of
https://github.com/stack-auth/stack.git
synced 2026-06-13 21:01:21 +08:00
Update apps/backend/scripts/run-cron-jobs.ts
Co-authored-by: Konsti Wohlwend <n2d4xc@gmail.com>
This commit is contained in:
parent
3f2a8efcfb
commit
dcda40246f
@ -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);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user