-
Notifications
You must be signed in to change notification settings - Fork 155
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
Github rate limit #84
Comments
not sure what you mean by "no handling of the rate limit" one thing I could think of improving on tentacats side is trying to implement https://developer.github.com/v3/#conditional-requests but I'm not sure whether that would be a solution for your usecase. |
That would most likely greatly improve my rate limiting... I'd give a 👍 that What I mean is that I get that exception when I hit the limit. Perhaps instead of returning the data, Tentacat should return a |
I implemented a caching layer around Tentacat for this reason. The code for the cache layer is here: https://github.com/thinkthroughmath/dev_wizard/blob/master/lib/dev_wizard/github_gateway/cache.ex Usage is here: https://github.com/thinkthroughmath/dev_wizard/blob/master/lib/dev_wizard/github_gateway.ex#L34 This solved the problem for us. |
There's a discussion about adding a cache store support to httpoison edgurgel/httpoison#172 . Maybe this could help us all! |
Hmm. The rate limit is not a problem, imho. The lack of exposure of the rate limit headers in the response is a problem - i.e.
The ETag and Last-Modified headers are also important when working with Github.
I guess this will break the world in terms of case statements with the signature changing from :
to :
There is also a Github Ratelimit API - https://developer.github.com/v3/rate_limit/ but hitting it all the time and dealing with the coordination is gonna be a pita when the info is already being returned in each individual request. Any thoughts? I mean, in the worst case I can just do raw requests for everything but I'm sure anyone that hits github with a lot of requests is gonna have a similar need (they rate-limit very early, especially when un-authenticated) Full disclosure, I'm writing a CI server. |
Quick experiment, changing the process_response implementation - 116 of 198 tests fail) - looks like it does break the world 😂
|
@edgurgel - any suggestions to work around this feature? Tentacat 2.0? Fork it. Submit a massive p/r ? |
@bryanhuntesl, well Tentacat is not 1.0.0 yet so we can do breaking changes! I wonder if we should just always return the raw HTTPoison response as the third argument. It will avoid issues in the future and simplify some weird use cases. What do you think? |
Sounds good to me. I can't think of a better way to do it
…On Sun, 26 Nov 2017 7:26 PM Eduardo Gurgel, ***@***.***> wrote:
@bryanhuntesl <https://github.com/bryanhuntesl>, well Tentacat is not
1.0.0 yet so we can do breaking changes! I wonder if we should just always
return the raw HTTPoison response as the third argument. It will avoid
issues in the future and simplify some weird use cases. What do you think?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#84 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/Aego9tYAC5fHQl9UwORTz-wJFrpZcgXsks5s6bt6gaJpZM4IeSCd>
.
|
And then it's kinda of "easy" to build a module to check for the rate limiting based on the HTTPoison.Response? Something like: |
Nice. I'm thinking of a process with an ets table or a process per token. I'm working my way through the unit tests btw. Will create a branch and p/r for review soon. |
@mgwidmann - see #132 - I'll share whatever I build on top of that - most likely a coordinator per token |
Currently theres no handling of the rate limit in this project. I regularly hit the rate limit (usually at the end of the hour) and would like to hear your thoughts on how to handle this properly.
Heres the exception I get when that happens:
The text was updated successfully, but these errors were encountered: