Skip to content

Feat: scheduled jobs on Vercel Cron (Hobby plan), no Redis - #9

Merged
ftaakash merged 1 commit into
mainfrom
feat/vercel-cron
Oct 13, 2026
Merged

ftaakash merged 1 commit into
mainfrom
feat/vercel-cron

Conversation

@ftaakash

Copy link
Copy Markdown
Owner

Moves the background worker's scheduled jobs to Vercel Cron so they run without Redis or a separate server.

Job Schedule (IST) Notes
market daily 01:30 resumable: loads roles not yet loaded this week
billing daily 06:00 expire lapsed plans, drop abandoned checkouts, renewal reminders
openclaw daily 06:30 nightly agent run for active students
sprints daily 07:00 was every 5 min on the worker; Hobby allows once a day
openclaw-dedupe daily 08:30
reports 1st of month 08:00 skipped when SendGrid isn't configured

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_SECRET has been added to Vercel production.

No migration.

- 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
@vercel

vercel Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
skill-graph Ready Ready Preview Oct 13, 2026 7:07pm UTC

@ftaakash
ftaakash merged commit e749ab5 into main Oct 13, 2026
4 checks passed
@ftaakash
ftaakash deleted the feat/vercel-cron branch October 13, 2026 19:11

This branch was successfully deployed

1 active deployment
Preview — d7d25862 Deployed Oct 13, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant