Skip to content

feat: ADD rate-limiting functionality#1396

Open
mattclegg wants to merge 1 commit into
otto-de:mainfrom
mattclegg:rate-limiting
Open

feat: ADD rate-limiting functionality#1396
mattclegg wants to merge 1 commit into
otto-de:mainfrom
mattclegg:rate-limiting

Conversation

@mattclegg

Copy link
Copy Markdown

I was getting blocked when querying a large number of repositories (~2k).

Any feedback welcome.

Thanks

@boring-cyborg boring-cyborg Bot added the java Changes related to backend label Jul 1, 2026
@boring-cyborg

boring-cyborg Bot commented Jul 1, 2026

Copy link
Copy Markdown

Thanks for opening this pull request! Please check out our contributing guidelines!

@mattclegg mattclegg changed the title ADD rate-limiting functionality feat: ADD rate-limiting functionality Jul 1, 2026

private static boolean isRateLimited(HttpClientErrorException exception) {
final boolean rateLimitStatus =
FORBIDDEN.equals(exception.getStatusCode())

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

429 is only rate limit status code, isn't it? FORBIDDEN is slightly different

}
log.warn("GitHub rate limit hit; waiting {}s until reset", waitFor.toSeconds());
try {
Thread.sleep(waitFor.toMillis());

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it hang the complete system? also given waitUntilRateLimitResets will be called multiple times, multiple Threads will go on sleep mode. Ideally if the rate-limit got hit, then we should skip the remaining calls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

java Changes related to backend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants