diff --git a/notify/slack/slack.go b/notify/slack/slack.go index 45a08719..8d083909 100644 --- a/notify/slack/slack.go +++ b/notify/slack/slack.go @@ -49,7 +49,7 @@ func New(c *config.SlackConfig, t *template.Template, l log.Logger) (*Notifier, tmpl: t, logger: l, client: client, - retrier: ¬ify.Retrier{}, + retrier: ¬ify.Retrier{RetryCodes: []int{http.StatusTooManyRequests}}, }, nil } diff --git a/notify/slack/slack_test.go b/notify/slack/slack_test.go index 2b77e63e..b5ebe641 100644 --- a/notify/slack/slack_test.go +++ b/notify/slack/slack_test.go @@ -15,6 +15,7 @@ package slack import ( "fmt" + "net/http" "testing" "github.com/go-kit/kit/log" @@ -35,7 +36,8 @@ func TestSlackRetry(t *testing.T) { ) require.NoError(t, err) - for statusCode, expected := range test.RetryTests(test.DefaultRetryCodes()) { + retryCodes := append(test.DefaultRetryCodes(), http.StatusTooManyRequests) + for statusCode, expected := range test.RetryTests(retryCodes) { actual, _ := notifier.retrier.Check(statusCode, nil) require.Equal(t, expected, actual, fmt.Sprintf("error on status %d", statusCode)) }