Repository navigation
Feat: scheduled jobs on Vercel Cron (Hobby plan), no Redis - #9
Merged
Merged
Conversation
- vercel.json: six daily/monthly crons (market data, billing, OpenClaw, sprints, OpenClaw dedupe, monthly reports), all within the Hobby limit of once per day - GET /api/cron/:job authenticated with Vercel's Authorization: Bearer CRON_SECRET (the x-cron-secret header still works); 300 s max duration, 270 s work budget - lib/scheduled.ts: the jobs, shared with the optional worker. Each stops starting new work at its deadline and resumes on the next run; market data loads role by role across runs - OpenClaw agent takes a deadline; nightly run order is randomised so a cut-off run doesn't always skip the same students - Emails are skipped (not failed) when SendGrid isn't configured
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Moves the background worker's scheduled jobs to Vercel Cron so they run without Redis or a separate server.
Hobby limits (Vercel docs): 100 crons/project, at most once per day, ±59 min timing, 300 s per function. Jobs stop starting new work at 270 s and resume next run.
Verification: 62/62 unit tests (cron auth, schedules fit Hobby, week calc), typecheck/lint/build clean. Local end-to-end on a disposable DB: no/wrong auth → 401, unknown job → 404; billing expired the lapsed plan only and removed the abandoned checkout; dedupe marked the duplicate; sprints created one sprint; reruns are no-ops; old x-cron-secret route still works.
CRON_SECREThas been added to Vercel production.No migration.