forked from sensu-plugins/sensu-plugins-slack
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
handler-slack.rb: implement a retry-timeout strategy for contacting s…
…lack webhook In certain scenarios the slack webhook delivery might fail due to several reasons: - network issues - rate limit exceeded - internal server errors on slack api side On those cases the call to the webhook might fail and our message not get delivered, or worse, it can leave our handler hanging for too long. This commit implements a customizable retry strategy that tries to deliver the message several times to the webhook, with a timeout to do so. It also implements a sleep time in between retries. All of these 3 settings can be customized in the json config of the handler, with defaults to 5 retries with 5 second sleeps in between, and 10 seconds timeout for each try. This should incidentally solve issue sensu-plugins#15
- Loading branch information
1 parent
5ac1f1c
commit 1fcd5d3
Showing
1 changed file
with
59 additions
and
20 deletions.
There are no files selected for viewing
This file contains 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