Skip to content
Browse files

Fixing gen_leader so it actually works.

  • Loading branch information...
1 parent 1ff82e2 commit 4c0365d19329f0d11fb3145d23cdfd71510b8aab Micah Warren committed May 7, 2010
Showing with 8 additions and 8 deletions.
  1. +8 −8 contrib/misc/src/gen_leader.erl
View
16 contrib/misc/src/gen_leader.erl
@@ -759,7 +759,7 @@ loop(#server{parent = Parent,
{election} ->
%% io:format("Doing an election~n"),
Mide = E,%#election{leader = none, leadernode = none},
- E1 = startStage1(Mide),
+ E1 = startStage1(Mide, Server),
safe_loop(Server, candidate, E1, Msg);
{checklead, Node} ->
%% io:format("Checking lead~n"),
@@ -774,7 +774,7 @@ loop(#server{parent = Parent,
{Name, N} ! {election}
end, E1#election.candidate_nodes),
Mide = E1,%#election{leader = none, leadernode = none},
- E2 = startStage1(Mide),
+ E2 = startStage1(Mide, Server),
safe_loop(Server, candidate, E2, Msg);
false ->
%% io:format("conflict, I'll be getting told by the leader when to start an election~n"),
@@ -1349,12 +1349,12 @@ broadcast({from_leader, Msg}, ToNodes, E) ->
end,ToNodes),
E.
-iselem(_,[]) ->
- false;
-iselem(P,[{_,P}|_]) ->
- true;
-iselem(P,[_ | Ns]) ->
- iselem(P,Ns).
+%iselem(_,[]) ->
+% false;
+%iselem(P,[{_,P}|_]) ->
+% true;
+%iselem(P,[_ | Ns]) ->
+% iselem(P,Ns).
lesser(_,[]) ->
[];

0 comments on commit 4c0365d

Please sign in to comment.
Something went wrong with that request. Please try again.