elixir-tesla / tesla

The flexible HTTP client library for Elixir, with support for middleware and multiple adapters.
MIT License
2.01k stars 349 forks source link

feat: add support for should_retry with arity of 2 to Retry middleware #608

Closed mdlkxzmcp closed 1 year ago

mdlkxzmcp commented 1 year ago

Closes https://github.com/elixir-tesla/tesla/issues/578

I also formatted the middleware.ex as it caused the lining test to fail aaaand made a typo in the branch name 🤦

~I am open to ideas on how to make this work with what is described in that issue... I needed a way to prevent Retry from repeating POST/PUT requests on timeouts, so I wrote it and at first glance thought it was the same issue, but now I see it isn't :)~

Edit: with the addition of the suggested changes by @yordis, this now does in fact close the aforementioned issue 🎊

yordis commented 1 year ago

@teamon going to wait for your feedback just in case, but thus far, I am OK with the addition.