Skip to content

Commit af23fd8

Browse files
JoeriDijkstrajoeri dijkstra
andauthored
fix: refresh error spam on direct_state (no lb) (#456)
* fix: refresh error spam on direct_state (no lb) * chore: formatting connection module --------- Co-authored-by: joeri dijkstra <joeri.dijkstra@bettyblocks.com>
1 parent 412baf6 commit af23fd8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/grpc/client/connection.ex

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,8 @@ defmodule GRPC.Client.Connection do
273273
:refresh,
274274
%{lb_mod: lb_mod, lb_state: lb_state, real_channels: channels, virtual_channel: vc} =
275275
state
276-
) do
276+
)
277+
when not is_nil(lb_mod) do
277278
{:ok, {prefer_host, prefer_port}, new_lb_state} = lb_mod.pick(lb_state)
278279

279280
channel_key = "#{prefer_host}:#{prefer_port}"
@@ -294,6 +295,8 @@ defmodule GRPC.Client.Connection do
294295
end
295296
end
296297

298+
def handle_info(:refresh, state), do: {:noreply, state}
299+
297300
def handle_info({:DOWN, _ref, :process, pid, reason}, state) do
298301
Logger.warning(
299302
"#{inspect(__MODULE__)} received :DOWN from #{inspect(pid)} with reason: #{inspect(reason)}"

0 commit comments

Comments
 (0)