-
Notifications
You must be signed in to change notification settings - Fork 0
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
Request: Better errors handling and a request limiter #4
Comments
Okay sure thing. |
Should be fixed in e843406, but the bucket code should handle the ratelimit anyway by only sending one per second. However I really should update that to respect 60/m instead of 1/s. |
Also, it will be great to add to the module any limiter.
|
Oh this is neat, I'll have a look at it and implement it when I get a chance |
Version 1.5.0 has been published using the Bottleneck library instead of the old Bucket code. However it still requests 1/s (or 1/0.2s for key users) because I can't figure out how to get it to request as soon as possible without dropping jobs. The strategies are hard to understand, but as I read them, it either will fail to schedule or submit jobs if it is in blocking mode which is a little weird. |
Let me explain how to avoid any errors.
It means that we will have the only one worker, that will init the jobs with 1 sec timeout.
When a job fails, I block the job using reservoir, make my app sleep for 10 sec(avoid unnesessary calls to API when it blocked due to the request limit) and append the job to the end for the chain of jobs Here the simplest example for parsing matches by IDs
|
I just need to add a logic to filter the 50.000 limit of request per day and catch other uncommon cases |
I'm reading this blocked strategy documentation:
To me this seems like if a user makes too many requests the internal Bottleneck object will drop all the queued calls. So either the user needs access to the internal Bottleneck object or there needs to be library logic to auto retry on a request. I'm thinking that the way I initialize the Bottleneck object right now will just simply only make requests every so often, and the user should never hit a rate limit unless they run out of calls for the month. Now as for your case couldn't you just intercept the error that the library gives you and retry it again using the internal queue? |
Opendota throws the error even with minTime: 1000, I guess OD has bugs or my channel bandwidth makes some latencies. |
Hi!
I guess we need a bit better errors handler at the line 59
For example, OD can throws an exception related to the requests limit per second and it's a bit tricky to a new user to understand what happened, because the error value will be NULL. So, please, throw the reject with an object :
or smth like this.
The text was updated successfully, but these errors were encountered: