fix(performance): fetch GitHub commits concurrently to prevent serverless timeouts#3174
fix(performance): fetch GitHub commits concurrently to prevent serverless timeouts#3174nyxsky404 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):
|
|
Good instinct on the serverless timeout, but firing pages 2..N as fully-parallel |
This PR refactors the GitHub Search API pagination in
fetchContributionsForAccount. Previously, the route fetched up to 10 pages sequentially in awhileloop, which could take up to 20 seconds for highly active users and frequently caused 504 Gateway Timeouts on Vercel's edge/serverless architecture. The new implementation fetches the first page to determine thetotal_count, and then fetches the remaining required pages (up to 10 max) concurrently usingPromise.all(). This drastically reduces the total execution time while correctly handling secondary rate limit (HTTP 429/403) fallbacks. Fixes #3170.