retry failed messages
This commit is contained in:
parent
014adbb315
commit
5f52a995a7
1 changed files with 7 additions and 1 deletions
|
@ -79,7 +79,13 @@ func sendToSlack(channel, username, message string) error {
|
|||
err = errors.Err("no slack token provided")
|
||||
} else {
|
||||
log.Debugln("slack: " + channel + ": " + message)
|
||||
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 {
|
||||
|
|
Loading…
Reference in a new issue