We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ffa283e commit 3fdaef4Copy full SHA for 3fdaef4
1 file changed
scanners/git-repo-scanner/scanner/internal/git_repo_scanner/github_repo_scanner.go
@@ -245,12 +245,17 @@ func (g *GitHubRepoScanner) respectGitHubRateLimit() error {
245
return nil
246
}
247
248
- // Only check rate limit every 50 API calls OR every 30 seconds
249
- if g.requestsSinceCheck < 50 && time.Since(g.lastRateLimitCheck) < 30*time.Second {
+ // Determine check interval based on authentication
+ // For unauthenticated (60/hour), check more frequently
250
+ checkInterval := 50
251
+ if g.accessToken == "" {
252
+ checkInterval = 5
253
+ }
254
+
255
+ if g.requestsSinceCheck < checkInterval && time.Since(g.lastRateLimitCheck) < 30*time.Second {
256
257
258
- // Reset counters
259
g.requestsSinceCheck = 0
260
g.lastRateLimitCheck = time.Now()
261
0 commit comments