safwank / ElixirRetry

Simple Elixir macros for linear retry, exponential backoff and wait with composable delays
Other
441 stars 32 forks source link

Getting the retry attempt number in the body of retry #9

Closed rosacris closed 7 years ago

rosacris commented 7 years ago

Hi,

we are using ElixirRetry in our project and we were wondering if it is possible to retrieve the current retry attempt count in the body of the retry macro. We are interested in such feature because we would like to increase HTTPotion timeout value in successive retries.

Thanks

safwank commented 7 years ago

Off the top of my head, doing so would be a bit tricky. Out of curiosity, why do you need to increase the timeout?

rosacris commented 7 years ago

Hi,

during the initialization of our Elixir service, we need to consume from another backend service using HTTP. Certain requests are slow no matter on the load (> x3 the averge). For such cases, we would like to have a way to increase the timeout threshold in HTTPotion, otherwise they will never be able to succeed.

safwank commented 7 years ago

OK.

At any rate, it's a cool feature to have. I don't know if I can commit to it in the near future, but I welcome a PR.