HandbookII the ForumBackground jobs and cron
IIthe Forum, The shape of an appBackground jobs and cron
In plain words
A background job is work your app does after the visitor has moved on, and cron is a timer that starts jobs on a schedule, such as nightly at 2am.
Where you see it
A crons section in vercel.json, a scheduled function in Supabase, or a dashboard such as Inngest or Trigger.dev. QuickBite's Monday-morning receipt summary goes out because a cron job sends it, not because anyone clicked anything.
What goes wrong
- Doing slow work while the visitor waits
Generating a PDF or emailing 500 members inside one request makes the page hang, and hosts cut requests off after a time limit. Hand the work to a job and answer the visitor at once.
- Forgetting the schedule is in UTC
Vercel reads cron times in UTC, so 0 9 * * * is 9am in London only in winter, and 4 or 5am in New York. Pick the hour on purpose.
- Leaving the cron route open
A cron job is a normal web address. Without a secret check, anyone who finds /api/cron/weekly-receipts can trigger 5,000 emails.
What to tell your agent
Quick check
Sign in to earn +10 XP for itGuildhall's "invite all members" button spins for a minute, then fails with a timeout, though some invites went out. Best fix?