Skip to content
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

Handle HTTP 429, rate limiting #13

Closed
wants to merge 1 commit into from
Closed

Conversation

goetzk
Copy link
Collaborator

@goetzk goetzk commented Feb 21, 2018

Per the announcement on Discourse meta, global API rate limits have been
introduced to the Discourse API.
This change adds a new DiscourseRateLimitedError class and a retry mechanism on
receipt of a 429.

https://meta.discourse.org/t/global-rate-limits-in-discourse/78612

Closes: #11

I do have one question: Should the 'settings' (retry_{count,backof}) be defined somewhere easier to change?

Per the announcement on Discourse meta, global API rate limits have been
introduced to the Discourse API.
This change adds a new DiscourseRateLimitedError class and a retry mechanism on
receipt of a 429.

https://meta.discourse.org/t/global-rate-limits-in-discourse/78612

Closes: pydiscourse#11
@goetzk
Copy link
Collaborator Author

goetzk commented Mar 13, 2018

Not sure if this will impact on this PR but they may change how the wait period is reported.
https://meta.discourse.org/t/when-rate-limiting-is-hit-return-return-a-retry-after-header/81838

@goetzk
Copy link
Collaborator Author

goetzk commented May 2, 2018

Looks like a Retry-After header was added which could be used instead of checking the json for wait_seconds.

https://github.com/discourse/discourse/pull/5659/files

@goetzk
Copy link
Collaborator Author

goetzk commented May 2, 2018

@bennylope Are there any changes you'd like to see here or are you willing to merge?

@simplesteph
Copy link

@bennylope any plans to merge this ? Retrying based on API throttle would be great for me!

@robbyoconnor
Copy link

Please merge this

@bennylope bennylope closed this in 0cef55a Apr 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Discourse API throttling.
3 participants