-
Notifications
You must be signed in to change notification settings - Fork 185
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
Added code for handling rate limits #186
base: master
Are you sure you want to change the base?
Conversation
2 similar comments
@@ -3,6 +3,9 @@ composer.lock | |||
*.sh | |||
script/* | |||
|
|||
# IDE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not required, you should be able to add IDE specific ignores to your global .gitignore and not the projects gitignore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@nortronthered please see our adjustments to rate limiting headers here: https://developer.bigcommerce.com/api/#rate-limits-oauth This may change your approach, hopefully for the better! |
I'd feel more comfortable with this if there was a setting to turn this on or off. |
Why have this not merged yet? |
A couple of reasons:
|
I'm checking for status code 429 in the handleReponse() method, which indicates that the rate limit has been reached, and simply delaying and then repeating the request after the allotted time from the 'X-Retry-After' header returned in the response, up to a maximum of 3 times for now. This has been tested locally using a script that generates over 9000 getTime() requests using OAuth authentication on a development store.