From 628cf36afed1748479a9c8c600dbf6f8eee05fad Mon Sep 17 00:00:00 2001 From: Geetansh Goyal Date: Fri, 4 Dec 2026 02:39:41 +0000 Subject: [PATCH] fix: run tracker sync cron daily so Hobby deploys pass Vercel's Hobby plan rejects any cron that runs more than once a day, so the */30 schedule from #200 failed the production deploy. Run it once a day at 00:30 UTC (06:00 IST) instead; mentors can still press refresh for fresher numbers. Co-Authored-By: Claude Opus 5.5 --- docs/first-year-tracker.md | 2 +- vercel.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/first-year-tracker.md b/docs/first-year-tracker.md index 494b75b..9584938 100644 --- a/docs/first-year-tracker.md +++ b/docs/first-year-tracker.md @@ -21,7 +21,7 @@ Page views read Firestore only. They never call GitHub. GitHub is called by the sync (`lib/tracker/sync.ts`), from two places: -- **Cron**: `GET /api/cron/tracker-sync`, every 30 minutes (`vercel.json`). Needs `CRON_SECRET`; without it the route returns 401. Vercel's Hobby plan only allows daily crons, so change the schedule there if needed. +- **Cron**: `GET /api/cron/tracker-sync`, once a day at 00:30 UTC (06:00 IST, `vercel.json`). Needs `CRON_SECRET`; without it the route returns 401. Vercel's Hobby plan only allows daily crons and fails the whole deploy on anything more often, so keep it daily unless the project moves to Pro. Hobby may fire it any time within that hour. One run refreshes one batch (see below), so with more than 20 students the rest are picked up on later days or by the refresh button. - **Refresh buttons**: `POST /api/admin/tracker/sync` (`tracker:view`, 12 calls per 15 minutes). With `{ "github": "" }` it refreshes one student (skipped if synced in the last 5 minutes); with no body it refreshes the next stale batch. Each run refreshes up to 20 students whose cache is older than 3 hours (one search each, oldest first) and stops at the first rate-limit response. A failed fetch keeps the old numbers and records `syncError`; it never turns into zeros. A sync updates PR counts, the PR list and last-activity dates. Status, priority, blocker, recommendation and appreciation come from the sheet and are not re-judged. diff --git a/vercel.json b/vercel.json index c37db17..27c9b8f 100644 --- a/vercel.json +++ b/vercel.json @@ -10,7 +10,7 @@ "crons": [ { "path": "/api/cron/tracker-sync", - "schedule": "*/30 * * * *" + "schedule": "30 0 * * *" } ] }