Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom http client Resty retry function does not work #1274

Open
rts-gordon opened this issue Apr 6, 2024 · 0 comments
Open

Custom http client Resty retry function does not work #1274

rts-gordon opened this issue Apr 6, 2024 · 0 comments

Comments

@rts-gordon
Copy link

rts-gordon commented Apr 6, 2024

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant