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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting retry delay on runtime. #632

Open
yuchunc opened this issue Oct 31, 2023 · 1 comment
Open

Setting retry delay on runtime. #632

yuchunc opened this issue Oct 31, 2023 · 1 comment

Comments

@yuchunc
Copy link

yuchunc commented Oct 31, 2023

Hello, 馃憢

I'm trying to create a retry strategy that retries based on Zendesk's rate limit response. The response looks something like this:

< HTTP/1.1 429
< Server: nginx/1.4.2
< Date: Mon, 04 Nov 2013 00:18:27 GMT
< Content-Type: text/html; charset=utf-8
< Content-Length: 85
< Connection: keep-alive
< Status: 429
< Cache-Control: no-cache
< X-Zendesk-API-Version: v2
< Retry-After: 93
< X-Zendesk-Origin-Server: ****.****.***.*****.com
< X-Zendesk-User-Id: 338231444
< X-Zendesk-Request-Id: c773675d81590abad33i
<
* Connection #0 to host SUBDOMAIN.zendesk.com left intact
* Closing connection #0
* SSLv3, TLS alert, Client hello (1):
Rate limit for ticket updates exceeded, please wait before updating this ticket again

In the headers, it tells us how many seconds to wait with Retry-After header. However, looking at Tesla.Middleware.Retry, it does not seem like I can set delay base on the response on runtime. If this is something Tesla retry is missing, maybe I can submit a PR? 馃檪

@yordis
Copy link
Member

yordis commented Oct 31, 2023

maybe I can submit a PR? 馃檪

馃コ please do, I am gonna be helping you with it

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

2 participants