slack-go/slack

Custom http client Resty retry function does not work

Opened this issue · 0 comments

What happened

Custom http client Resty's retry function does not work with slack-go.

Expected behavior

Resty's retry function should works with slack-go.

Steps to reproduce

My program send message to Slack channel via slack-go. I use a custom http client Resty and set it to do retry 3 times, but it is not works with slack-go.

I called the Post method via Resty directly without slack-go, the retry function works well.

I changed to another http client retryablehttp, the retry function works well with slack-go.

Can you please take a look at this, thank you.

reproducible code

slack-go code:

// transfor resty.Client to http.Client
httpClient = InitHttpClient().GetClient()
slack.PostWebhookCustomHTTP(url, httpClient, &msg)

Resty httpClient:

func InitHttpClient() *resty.Client {
	return resty.New().
		SetRetryCount(3).
		SetRetryWaitTime(1 * time.Second).
		SetRetryMaxWaitTime(20 * time.Second)
}

Versions

  • Go: v1.22
  • slack-go/slack: v0.12.5