Added code for handling rate limits#186
Open
n0rtr0n wants to merge 1 commit intobigcommerce:masterfrom
Open
Conversation
2 similar comments
gayanhewa
reviewed
Mar 6, 2017
| *.sh | ||
| script/* | ||
|
|
||
| # IDE |
There was a problem hiding this comment.
This is not required, you should be able to add IDE specific ignores to your global .gitignore and not the projects gitignore.
Contributor
|
@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! |
Contributor
|
I'd feel more comfortable with this if there was a setting to turn this on or off. |
|
Why have this not merged yet? |
Contributor
|
A couple of reasons:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.