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

document how to change retry configuration #305

Closed
lazopm opened this issue Dec 23, 2016 · 3 comments
Closed

document how to change retry configuration #305

lazopm opened this issue Dec 23, 2016 · 3 comments
Labels
docs M-T: Documentation work only
Milestone

Comments

@lazopm
Copy link

lazopm commented Dec 23, 2016

For the slack bot I'm working on I need to keep references to the bot's messages timestamps.
I've been using the callback of web.chat.postMessage to do that, however, I noticed that if the request errors because of rate limits it says it will retry in 1 second.
Does that retry execute the callback again?
Is there a way to disable retrying so I can manage throttling manually?

Thanks!

@DEGoodmanWilson
Copy link

Hello! It should execute your CB when it retries the endpoint. If it is not, that is a bug for sure!

At the moment, there is no way to disable retrying—is the existing logic not working for you? It might be a nice feature if we added a web api retry policy so you could specify how throttling should be handled. What do you think?

@lazopm
Copy link
Author

lazopm commented Dec 26, 2016

Hi! Thank you for the quick reply, I hope you are enjoying the holidays!
I saw some weird behavior from our bot that would be explained by requests going through but not triggering the callback. There was also some weird stuff going on with slack on Thurday with reactions and editing being broken, so it might have been related to that.
I will do some testing on Tuesday when I'm back from the holidays.

I think the existing retry logic works great for most projects, but mine would benefit from being able to turn it off.
The slack bot I'm working on posts the progress of our Jenkins builds to several channels. And updates the messages as the builds' state changes.
Often there are several jobs building simultaneously, and that is when I hit the API limits.

The problem with not being able to cancel the retry is that X seconds after the API call failed that message probably contains stale data and I would rather cancel that API call and make new one with fresh data.
It's really not that big of a deal, but I would like to use the 60 calls per minute as efficiently as possible.

@aoberoi
Copy link
Contributor

aoberoi commented Oct 3, 2017

you can now completely customize the retry behavior by passing a configuration object as opts.retryConfig to the WebClient constructor. the shape of this object is as defined in https://www.npmjs.com/package/retry as the "options" object.

changing this issue into a docs issue to make this more clear.

@aoberoi aoberoi added docs M-T: Documentation work only and removed Feature Request labels Oct 3, 2017
@aoberoi aoberoi changed the title Is there a way to get the ts of retried requests? document how to change retry configuration Oct 3, 2017
@aoberoi aoberoi added this to the v3.15.0 milestone Oct 27, 2017
@aoberoi aoberoi mentioned this issue Dec 22, 2017
2 tasks
@aoberoi aoberoi closed this as completed Dec 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs M-T: Documentation work only
Projects
None yet
Development

No branches or pull requests

3 participants