Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Avoid API Rate-Limiting #266

Merged
merged 3 commits into from
May 9, 2024
Merged

Conversation

lawang24
Copy link
Contributor

@lawang24 lawang24 commented May 2, 2024

Pull Request

Rate limiting of the Github search API is causing a 403 Authentication Error for some users. Issues #217 and potentially #166 are related.

Proposed Changes

The github3 SearchIterator object has a ratelimit_remaining property that is used to measure if we are near API rate limits. If remaining requests are low (<5), there is a 1 minute delay to refresh requests with exponential increases in delays (corresponding rate limit docs). This is consistent with Github's recommended best practice guidelines since the github3 wrappers prevent us from easily accessing the retry headers.

Readiness Checklist

Author/Contributor

  • If documentation is needed for this change, has that been included in this pull request
  • run make lint and fix any issues that you have introduced
  • run make test and ensure you have test coverage for the lines you are introducing

Reviewer

  • Label as either fix, documentation, enhancement, infrastructure, maintenance, or breaking

@lawang24 lawang24 changed the title Feat: Avoid API Rate-Limiting feat: Avoid API Rate-Limiting May 2, 2024
Copy link
Member

@jmeridth jmeridth left a comment

Choose a reason for hiding this comment

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

This LGTM. Want to get a review from @zkoppert also.

Thank you for your contribution

@zkoppert
Copy link
Member

zkoppert commented May 3, 2024

Testing this one locally and running into issues that also happen on the main branch. Will continue trying to figure out what's going on so I can see this in action.

@zkoppert
Copy link
Member

zkoppert commented May 9, 2024

Still working on this, Thanks for hanging in there. I'm currently trying to rule out what is causing the issue and then doing local reruns.

@zkoppert zkoppert merged commit 14dbf10 into github:main May 9, 2024
13 checks passed
@lawang24 lawang24 deleted the Avoid-Rate-Limiting branch May 10, 2024 03:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants