Fix: Reduce GitHub API rate limit usage by 75%#448
Merged
Conversation
Problem: The UI was polling GitHub every 15 seconds, making 3 API calls per repository per poll (open, merged, and closed PRs). This resulted in 720 API calls per hour for a single repo, easily exceeding GitHub's rate limits (5,000/hour authenticated, 60/hour unauthenticated). Changes: 1. Increased PR refresh interval from 15s to 60s (4x reduction) 2. Increased cache TTL from 15s to 90s (6x increase) 3. Added rate limit error detection and graceful handling Impact: - API usage reduced from 720 calls/hour to 180 calls/hour (75% reduction) - PR information still refreshes every minute (reasonable for CI checks) - Cache now lasts longer than refresh interval, improving efficiency - Rate limit errors are detected and handled gracefully Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Problem
The UI was hitting GitHub rate limits due to aggressive polling:
Solution
API Usage Impact:
Changes:
Test Plan
Files Changed
internal/github/pr.go: Increased cache TTL, added rate limit detectioninternal/ui/app.go: Increased refresh tick interval from 15s to 60s🤖 Generated with Claude Code