-
Notifications
You must be signed in to change notification settings - Fork 59
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
Add 'reset' option to reset limit counter at the end of each interval. #1
base: master
Are you sure you want to change the base?
Conversation
Thanks for the pull request. Do you know of other APIs that reset their counters as well? I'll have to think about this one a bit before merging. I'm not 100% sure a reset option is necessary. |
Sure. I never used any other API that reset its counters, but googling for "api rate limit reset at midnight" shows that there are some other APIs like this, though not a lot. Anyway, I just have to deal with LinkedIn API, and if the counter is reset at midnight, it doesn't make sense to delay any throttled request for full 24 hours. |
Right. I hadn't thought of the issue of throttled jobs when a sidekiq_options throttle: { threshold: 100_000, period: 1.day } Would be reduced to: sidekiq_options throttle: { threshold: 125, period: 108.seconds } It has the added benefit of spreading out job executions rather than creating a massive flood of activity then idling until the end of a long period. The only issue I have with the addition of a Let me know if this works for you. I might be completely crazy. |
I agree the option is confusing. I'll try how it works first. And let me also tell you few other things about LinkedIn API. I don't know if these features would be in great demand by users of other APIs though.
I hope this makes sense. :) |
I'm also battling the LinkedIn API right now and am working around the same limitations. |
In particular that would be useful for LinkedIn API who reset daily counters at midnight UTC.