Skip to content

Support x-ratelimit-reset handling for secondary rate limits - #2775

Merged
gmlewis merged 3 commits into
google:masterfrom
gofri:master
May 14, 2023
Merged

Support x-ratelimit-reset handling for secondary rate limits#2775
gmlewis merged 3 commits into
google:masterfrom
gofri:master

Conversation

@gofri

Copy link
Copy Markdown
Contributor

GitHub API states that x-ratelimit-reset might be returned instead of the Retry-After header for secondary rate limits.
Seems like GitHub recently started using it. Some evidence:

This PR handles this case as a fallback for Retry-After, and cleans the code a bit while at it

@google-cla

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@codecov

codecovBot commented Apr 29, 2023

Copy link
Copy Markdown

Codecov Report

Merging #2775 (e33c536) into master (a938017) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@ Coverage Diff @@## master #2775 +/- ##
=======================================
Coverage 98.05% 98.05% =======================================
Files 132 132 Lines 11638 11648 +10 =======================================
+ Hits 11412 11422 +10 
Misses 154 154 Partials 72 72 
Impacted FilesCoverage Δ
github/github.go97.97% <100.00%> (+0.02%)⬆️

@gmlewisgmlewis left a comment

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.

Thank you, @gofri !
LGTM.

Awaiting CLA and second LGTM+Approval from any other contributor to this repo before merging.

@gmlewisgmlewis added the NeedsReview PR is awaiting a review before merging. label Apr 29, 2023
Comment threadgithub/github_test.go Outdated
@gmlewis

Copy link
Copy Markdown
Collaborator

Thank you, @valbeat !
Merging.

@gmlewisgmlewis removed the NeedsReview PR is awaiting a review before merging. label May 14, 2023
@gmlewis
gmlewis merged commit 53cecba into google:masterMay 14, 2023
jlaportebot added a commit to jlaportebot/go-github that referenced this pull request Jun 28, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@gofri@gmlewis@valbeat