Skip to content

Commit

Permalink
Fix retrier logic (#1574)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeljguarino authored Nov 8, 2024
1 parent 4c18a5a commit ceac3fc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/console/retrier.ex
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
defmodule Console.Retrier do
require Logger

defstruct [:retry, :res, max: 3, pause: 100]
defstruct [:res, retry: 0, max: 3, pause: 100]

def new(opts), do: struct(__MODULE__, opts)

Expand All @@ -26,5 +26,5 @@ defmodule Console.Retrier do
end
end

defp jitter(pause), do: :rand.uniform(floor(pause / 2)) - :timer.seconds(floor(pause / 4))
defp jitter(pause), do: :rand.uniform(floor(pause / 2)) - floor(pause / 4)
end

0 comments on commit ceac3fc

Please sign in to comment.