GithubHelp home page GithubHelp logo

Rate limiting? about pygithub HOT 5 CLOSED

pygithub avatar pygithub commented on May 22, 2024
Rate limiting?

from pygithub.

Comments (5)

jacquev6 avatar jacquev6 commented on May 22, 2024

Thank you for your feedback.

I have indeed not yet implemented this feature because I have no real use of it: each API call is more than half a second long, so it's hard to reach the rate limit.

Anyway, it is easy to extract the rate limiting headers, so I will add an attribute to the Github class to give access to their last value.

Expect it in version 1.0. I will set an expected date on the milestone during the week-end.

from pygithub.

bilderbuchi avatar bilderbuchi commented on May 22, 2024

Ah good point about it being hard to reach. Thanks for implementing it. No hurry, though, it's not that important. :-)

from pygithub.

jacquev6 avatar jacquev6 commented on May 22, 2024

Implemented in ca97469. Will be in version 1.0.

from pygithub.

bilderbuchi avatar bilderbuchi commented on May 22, 2024

Thanks. :-)

from pygithub.

brianjmurrell avatar brianjmurrell commented on May 22, 2024

each API call is more than half a second long, so it's hard to reach the rate limit.

For the absolute max rate limit, yes. But it's really quite easy to trigger abuse rate limiting:

[2019-04-09T10:02:14.101Z] 2019-04-09 10:02:11,214 POST https://api.github.com/.../pulls/284/reviews {'Content-Type': 'application/json', 'Authorization': 'Basic (login and password removed)', 'User-Agent': 'PyGithub/Python'} {...} ==> 422 {'status': '422 Unprocessable Entity', 'x-accepted-oauth-scopes': '', 'content-length': '171', 'x-github-media-type': 'github.v3; format=json', 'content-security-policy': "default-src 'none'", 'x-content-type-options': 'nosniff', 'access-control-expose-headers': 'ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type', 'x-github-request-id': '9F34:7C5C:3ABC39:7696C8:5CAC6DA0', 'strict-transport-security': 'max-age=31536000; includeSubdomains; preload', 'x-ratelimit-remaining': '4719', 'server': 'GitHub.com', 'x-ratelimit-limit': '5000', 'x-oauth-scopes': 'notifications, public_repo', 'date': 'Tue, 09 Apr 2019 10:02:11 GMT', 'x-frame-options': 'deny', 'access-control-allow-origin': '*', 'referrer-policy': 'origin-when-cross-origin, strict-origin-when-cross-origin', 'content-type': 'application/json; charset=utf-8', 'x-xss-protection': '1; mode=block', 'x-ratelimit-reset': '1554806424'} {"message":"Unprocessable Entity","errors":["was submitted too quickly"],"documentation_url":"https://developer.github.com/v3/pulls/reviews/#create-a-pull-request-review"}

#1084, FWIW.

from pygithub.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.