Skip to content

Commit

Permalink
Do not call retry_delay fun twice for one request/response
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanluptak committed Sep 20, 2024
1 parent 380f1e9 commit 005e55b
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 005e55b

Please sign in to comment.