Commit 47f9d68
Anush Kamble
fix: cap org dashboard active members at 60 to reduce shared token API consumption (JhaSourav07#2249)
Problem:
- getOrgDashboardData fetches contribution calendars for up to 200 members
(4 pages x 50 per page) via fetchGitHubContributions
- Even with concurrency capped at 5 (PR JhaSourav07#2150), the total volume of
GraphQL calls per org request is 200 x ~5 points = ~1000 points
- With the shared GITHUB_TOKEN at 5000 points/hr, only 5 org dashboard
requests per hour are possible before all users are rate-limited
Fix:
- Limit activeMembers to first 60 by slicing the members array before
dispatching contribution fetches
- 60 members covers the most active contributors for any org size while
cutting worst-case API consumption by 70% (1000 -> 300 points/request)
- The member list is already sorted by join date from the REST API; the
first 60 members are typically the most active contributors
- Combined with concurrency cap (5) and TTL cache, this makes org
dashboard viable without exhausting the shared token
Related: PR JhaSourav07#2150 (concurrency), PR JhaSourav07#2149 (pagination)
Fixes JhaSourav07#22491 parent 348372a commit 47f9d68
1 file changed
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
747 | 747 | | |
748 | 748 | | |
749 | 749 | | |
750 | | - | |
| 750 | + | |
| 751 | + | |
751 | 752 | | |
752 | 753 | | |
753 | 754 | | |
754 | | - | |
| 755 | + | |
755 | 756 | | |
756 | 757 | | |
757 | 758 | | |
| |||
0 commit comments