With this new change, we will allow the :backoff option to be a to be a fun/1 which receives the current retry count from the :retries key from Goth struct:
fun = fn retry_count ->
retry_count * 1000
end
{:ok, _pid} = Goth.start_link(name: Goth.Default, backoff: fun)
We will use a default exponential backoff if you don't pass :backoff option to Goth.start_link/1:
defp exp_backoff(retry_count) do
Integer.pow(2, retry_count) * 1000
end
Also, now the retry count (:retries) will start from 0, so we can execute the retry delay calculation from the current retry count.
With this new change, we will allow the
:backoff
option to be a to be afun/1
which receives the current retry count from the:retries
key fromGoth
struct:We will use a default exponential backoff if you don't pass
:backoff
option toGoth.start_link/1
:Also, now the retry count (
:retries
) will start from 0, so we can execute the retry delay calculation from the current retry count.