Skip to content

Commit

Permalink
retry: Do not call retry_delay fun twice (#414)
Browse files Browse the repository at this point in the history
Closes #308
  • Loading branch information
stefanluptak authored Sep 22, 2024
1 parent 380f1e9 commit ad18d19
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lib/req/steps.ex
Original file line number Diff line number Diff line change
Expand Up @@ -2109,14 +2109,12 @@ defmodule Req.Steps do
fun when is_function(fun, 1) ->
case fun.(retry_count) do
delay when is_integer(delay) and delay >= 0 ->
delay
{request, delay}

other ->
raise ArgumentError,
"expected :retry_delay function to return non-negative integer, got: #{inspect(other)}"
end

{request, fun.(retry_count)}
end
end

Expand Down

0 comments on commit ad18d19

Please sign in to comment.