Fix duplicate APRS-IS connections in clustered deployments

Prevent both AprsIsConnection and cluster-managed Is connection from
starting simultaneously. When clustering is enabled, only the cluster's
ConnectionManager should handle APRS-IS connections via leader election.

This resolves aprsc server disconnections caused by duplicate validated
clients with the same username (W5ISP-1).

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Graham McIntire 2025-07-25 12:10:47 -05:00
parent 94fad09901
commit 437ccebbaa
No known key found for this signature in database

View file

@ -139,8 +139,10 @@ defmodule Aprsme.Application do
defp maybe_add_aprs_connection(children, _env) do
disable_connection = Application.get_env(:aprsme, :disable_aprs_connection, false)
cluster_enabled = Application.get_env(:aprsme, :cluster_enabled, false)
if disable_connection do
# Don't add AprsIsConnection if clustering is enabled or connection is disabled
if disable_connection or cluster_enabled do
children
else
children ++ [Aprsme.AprsIsConnection]