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 Slack API rate limiting #151

Merged
merged 4 commits into from
Sep 25, 2019
Merged

Handle Slack API rate limiting #151

merged 4 commits into from
Sep 25, 2019

Conversation

milesbxf
Copy link
Contributor

Implements a simple retry+incremental backoff for when we get rate limited
by Slack (though easy to enable retries for other errors too).

Given a base backoff (default 200ms) and maximum retries, we retry up to
the max, backing off by the base multiplied by the number of retries. We
could probably use a library to implement a more complex exponential
backoff, but I think this should suffice for now.

I've gone for an iterative approach over recursion to avoid stack
overflows.

Implements a simple retry+incremental backoff for when we get rate limited
by Slack (though easy to enable retries for other errors too).

Given a base backoff (default 200ms) and maximum retries, we retry up to
the max, backing off by the base multiplied by the number of retries. We
could probably use a library to implement a more complex exponential
backoff, but I think this should suffice for now.

I've gone for an iterative approach over recursion to avoid stack
overflows.
@milesbxf milesbxf requested a review from mattrco September 24, 2019 16:55
@milesbxf milesbxf merged commit a1957b6 into master Sep 25, 2019
@milesbxf milesbxf deleted the slack-rate-limit-backoff branch September 25, 2019 10:09
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.

2 participants