fix: paginate weekly-digest cron query to prevent serverless timeout - #2363
fix: paginate weekly-digest cron query to prevent serverless timeout#2363Meera2906 wants to merge 2 commits into
Conversation
GSSoC Label Checklist 🏷️@Priyanshu-byte-coder — please apply the appropriate labels before merging: Difficulty (pick one):
Quality (optional):
Validation (required to score):
|
|
This PR has merge conflicts with the current git fetch origin main
git merge origin/main
# resolve conflicts
git push |
|
CI is failing on the type check. Please fix the TypeScript errors and push again. |
|
Pagination logic has a bug: |
|
This has merge conflicts with main. Please rebase/resolve conflicts and make sure CI is green — then it'll get a fresh review. |
|
The pagination idea is right (same fix I recently merged for the discord and wakatime cron jobs — #3190/#3203), but this branch doesn't compile: Fix the syntax so |
|
Closing as stale. The last commit on this branch was 2026-06-17, over a month ago, and there's been no activity since. It also has merge conflicts against current This isn't a rejection of the idea — DevTrack's PR queue grew past 110 open PRs, so I'm clearing branches that have gone quiet so the review tab reflects what's actually in progress. If you still want to land this: rebase on current |
Problem
The weekly-digest cron fetched all opted-in users in a single unbounded
Supabase query. With 200+ users and ~300ms per email send, the function
reliably exceeded Vercel's 60s timeout, causing partial delivery with no
retry mechanism.
Fix
Replaced the unbounded query with a paginated loop using
.range():Fixes #1852