Skip to content

Commit

Permalink
min 0 jitter value
Browse files Browse the repository at this point in the history
  • Loading branch information
btkostner committed Dec 6, 2023
1 parent f32a0cb commit d5332a2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/buffy/throttle.ex
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ defmodule Buffy.Throttle do
@impl GenServer
@spec handle_info(:timeout, Buffy.Throttle.state()) :: {:stop, :normal, Buffy.Throttle.state()}
def handle_info(:timeout, {key, args}) do
selected_jitter = :rand.uniform(unquote(jitter) + 1) - 1
selected_jitter = min(:rand.uniform(unquote(jitter) + 1) - 1, 0)

:telemetry.execute([:buffy, :throttle, :handle, :jitter], %{jitter: selected_jitter}, %{
args: args,
Expand Down

0 comments on commit d5332a2

Please sign in to comment.