Skip to content

Commit

Permalink
do not block nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
leandrocp committed Apr 3, 2024
1 parent 782022d commit 040a9fb
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions lib/beacon/live_admin/cluster.ex
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ defmodule Beacon.LiveAdmin.Cluster do
require Logger

@scope :beacon_cluster
@remote_call_retries 3

@doc false
def start_link(opts) do
Expand Down Expand Up @@ -56,7 +55,6 @@ defmodule Beacon.LiveAdmin.Cluster do

def call(site, mod, fun, args)
when is_atom(site) and is_atom(mod) and is_atom(fun) and is_list(args) do
id = Module.concat([mod, fun])
nodes = find_nodes(site)

if nodes == [] do
Expand All @@ -67,15 +65,8 @@ defmodule Beacon.LiveAdmin.Cluster do
raise Beacon.LiveAdmin.ClusterError, message: message
end

:global.trans(
{id, self()},
fn ->
node = pick_node(nodes)
do_call(site, node, mod, fun, args)
end,
nodes,
@remote_call_retries
)
node = pick_node(nodes)
do_call(site, node, mod, fun, args)
end

defp do_call(site, node, mod, fun, args) do
Expand Down

0 comments on commit 040a9fb

Please sign in to comment.