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

Don't update the ratelimits if we got a response from a cache #2273

Merged
merged 1 commit into from Feb 17, 2022

Conversation

Jille
Copy link
Contributor

@Jille Jille commented Jan 26, 2022

The recommended cache, https://github.com/gregjones/httpcache, returns
an X-From-Cache: 1 header whenever it serves a response from the cache.

Cached responses might include (possibly stale) ratelimit headers, which
we would've already processed in the past.

@codecov
Copy link

codecov bot commented Jan 26, 2022

Codecov Report

Merging #2273 (2b58fd7) into master (a842efc) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2273   +/-   ##
=======================================
  Coverage   97.83%   97.83%           
=======================================
  Files         115      115           
  Lines       10360    10363    +3     
=======================================
+ Hits        10136    10139    +3     
  Misses        156      156           
  Partials       68       68           
Impacted Files Coverage Δ
github/github.go 97.64% <100.00%> (+0.01%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a842efc...2b58fd7. Read the comment docs.

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, @Jille !
Can you please add a unit test that demonstrates this change in functionality?

Also, once you sign the CLA, we can move forward with this PR.

The recommended cache, https://github.com/gregjones/httpcache, returns
an X-From-Cache: 1 header whenever it serves a response from the cache.

Cached responses might include (possibly stale) ratelimit headers, which
we would've already processed in the past.
@Jille
Copy link
Contributor Author

Jille commented Feb 7, 2022

Thanks for the quick review :)

Added tests, rebased to master, signed the CLA.

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, @Jille !
LGTM.

Awaiting second LGTM from any other contributor to this repo before merging.

Copy link
Contributor

@raynigon raynigon left a comment

Choose a reason for hiding this comment

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

LGTM

@gmlewis
Copy link
Collaborator

gmlewis commented Feb 17, 2022

Thank you, @raynigon !
Merging.

@gmlewis gmlewis merged commit 77b2d75 into google:master Feb 17, 2022
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