Skip to content

Commit

Permalink
Updating gen_cluster with abeccui's changes
Browse files Browse the repository at this point in the history
  • Loading branch information
auser committed Jul 21, 2010
1 parent 55b7fc7 commit 0e0b329
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/gen_cluster.erl
Expand Up @@ -117,9 +117,13 @@ run(Mod, Msg) ->
case ballot_run(Mod, Msg) of
{error, no_winner} ->
% Force a run
P = randomly_pick(gproc:lookup_pids({p,g,cluster_key(Mod)}), []),
call(P, Msg, infinity),
P;
case gproc:lookup_pids({p,g,cluster_key(Mod)}) of
[] -> {error, no_nodes};
Nodes ->
P = randomly_pick(Nodes, []),
call(P, Msg, infinity),
P
end;
{error, _} = T -> T;
{ok, _, _} = Good -> Good
end.
Expand Down

0 comments on commit 0e0b329

Please sign in to comment.