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

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

Merged
merged 3 commits into from May 14, 2023

Conversation

gofri
Copy link
Contributor

@gofri gofri commented Apr 29, 2023

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

google-cla bot commented Apr 29, 2023

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
Copy link

codecov bot commented Apr 29, 2023

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 Files Coverage Δ
github/github.go 97.97% <100.00%> (+0.02%) ⬆️

Copy link
Collaborator

@gmlewis gmlewis left a comment

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.

@gmlewis gmlewis added the NeedsReview PR is awaiting a review before merging. label Apr 29, 2023
github/github_test.go Outdated Show resolved Hide resolved
@gmlewis
Copy link
Collaborator

gmlewis commented May 14, 2023

Thank you, @valbeat !
Merging.

@gmlewis gmlewis removed the NeedsReview PR is awaiting a review before merging. label May 14, 2023
@gmlewis gmlewis merged commit 53cecba into google:master May 14, 2023
9 checks passed
Sign up for free to 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.

None yet

3 participants