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

Rate limiting log #12

Open
williammizuta opened this issue Jul 14, 2021 · 1 comment
Open

Rate limiting log #12

williammizuta opened this issue Jul 14, 2021 · 1 comment
Labels
question Further information is requested

Comments

@williammizuta
Copy link
Contributor

There is a limit for API requests that depends on many factors.

For every API request, Github returns the following three data in HTTP headers :

  • X-RateLimit-Limit The maximum number of requests you're permitted to make per hour.
  • X-RateLimit-Remaining The number of requests remaining in the current rate limit window.
  • X-RateLimit-Reset The time at which the current rate limit window resets in UTC epoch seconds.

It should be nice if the lib could allow applications to log this information

Reference: https://docs.github.com/en/rest/overview/resources-in-the-rest-api#rate-limiting

@williammizuta
Copy link
Contributor Author

Many APIs use clj-github.client-utils/fetch-body! to make the Request and ignoring HTTP headers information. It is possible to change this function or create another one, but it will break a lot of things. We could also change the clj-github.client-utils/fetch-body! to be a multi-arity functions and receive a logger and log the RateLimit data automatically, but I don't know if it is good for the lib.

@williammizuta williammizuta added the question Further information is requested label Jul 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant