Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/first-year-tracker.md
Original file line number Diff line number Diff line change
Expand Up @@ -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": "<handle>" }` 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.
Expand Down
2 changes: 1 addition & 1 deletion vercel.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"crons": [
{
"path": "/api/cron/tracker-sync",
"schedule": "*/30 * * * *"
"schedule": "30 0 * * *"
}
]
}
Loading