diff --git a/extras/util/slack.go b/extras/util/slack.go index 46a5f93..15584bf 100644 --- a/extras/util/slack.go +++ b/extras/util/slack.go @@ -79,7 +79,13 @@ func sendToSlack(channel, username, message string) error { err = errors.Err("no slack token provided") } else { log.Debugln("slack: " + channel + ": " + message) - _, _, err = slackApi.PostMessage(channel, slack.MsgOptionText(message, false), slack.MsgOptionUsername(username)) + for { + _, _, err = slackApi.PostMessage(channel, slack.MsgOptionText(message, false), slack.MsgOptionUsername(username)) + if strings.Contains(err.Error(), "timeout awaiting response headers") { + continue + } + break + } } if err != nil {