fix: Group handle_info clauses together in LeaderElection
Fixes compilation warning by moving the catch-all handle_info/2 clause to be immediately after the specific handle_info/2 clauses. In Elixir, all function clauses with the same name and arity must be grouped together for pattern matching to work correctly. This resolves the 'mix compile --warnings-as-errors' failure.
This commit is contained in:
parent
6bfea84b88
commit
21e395ec62
1 changed files with 6 additions and 6 deletions
|
|
@ -108,6 +108,12 @@ defmodule Aprsme.Cluster.LeaderElection do
|
|||
{:noreply, state}
|
||||
end
|
||||
|
||||
@impl true
|
||||
def handle_info(msg, state) do
|
||||
Logger.debug("LeaderElection received unexpected message: #{inspect(msg)}")
|
||||
{:noreply, state}
|
||||
end
|
||||
|
||||
@impl true
|
||||
def handle_call(:is_leader?, _from, state) do
|
||||
{:reply, state.is_leader, state}
|
||||
|
|
@ -118,12 +124,6 @@ defmodule Aprsme.Cluster.LeaderElection do
|
|||
{:reply, state.leader_node, state}
|
||||
end
|
||||
|
||||
@impl true
|
||||
def handle_info(msg, state) do
|
||||
Logger.debug("LeaderElection received unexpected message: #{inspect(msg)}")
|
||||
{:noreply, state}
|
||||
end
|
||||
|
||||
@impl true
|
||||
def terminate(reason, state) do
|
||||
if state.is_leader do
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue