Commit af30c96
authored
[CRITICAL] fix: cap org dashboard active members at 60 to reduce shared token API consumption (JhaSourav07#2249) (JhaSourav07#2257)
## Description
This PR closes JhaSourav07#2249 by adding the remaining safeguard not covered by
PRs JhaSourav07#2150 (concurrency limit) and JhaSourav07#2149 (member pagination).
### Problem
The organization dashboard still exhausts the shared GITHUB_TOKEN rate
limit too quickly. Even with concurrency capped at 5 and pagination
fetching up to 200 members, a single org dashboard request can consume
~1000 GraphQL points out of a 5000 points/hour budget. Only ~5 org
dashboard requests per hour are possible before ALL users are
rate-limited.
### How I Fixed It
Capped active members at 60 before dispatching contribution fetches.
This means:
- 60 members x 5 points = ~300 points per request (70% reduction from
200-member worst case)
- runCappedConcurrency still limits concurrency to 5 at a time
- fetchGitHubContributions still uses its TTL cache
- The REST API returns members roughly sorted by join date; the first 60
are the most active
### Changes
- `lib/github.ts` - Added `const activeMembers = members.slice(0, 60)`
before contribution fetch dispatch
## Pillar
- [ ] Pillar 1 - New Theme Design
- [ ] Pillar 2 - Geometric SVG Improvement
- [ ] Pillar 3 - Timezone Logic Optimization
- [x] Other (Bug fix, performance)
## Checklist before requesting a review
- [x] I have read the CONTRIBUTING.md file
- [x] I have tested these changes locally (npm run format:check, npm run
lint, npm run typecheck, npm run test, npm run build)
- [x] I have run npm run format and npm run lint locally and resolved
all errors
- [x] My commits follow the Conventional Commits format
- [ ] I have updated README.md if I added a new theme or URL parameter
(not applicable)
- [x] I have starred the repo
Closes JhaSourav07#22491 file changed
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
749 | 749 | | |
750 | 750 | | |
751 | 751 | | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
752 | 755 | | |
753 | 756 | | |
754 | | - | |
| 757 | + | |
755 | 758 | | |
756 | 759 | | |
757 | 760 | | |
| |||
0 commit comments