fix: unsubscribe from pubsub topics on LiveView terminate; catch-all handle_info in ConnectionManager
This commit is contained in:
parent
177b88c3f3
commit
0b178d45ba
2 changed files with 7 additions and 0 deletions
|
|
@ -56,6 +56,9 @@ defmodule Aprsme.Cluster.ConnectionManager do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@impl true
|
||||||
|
def handle_info(_msg, state), do: {:noreply, state}
|
||||||
|
|
||||||
@impl true
|
@impl true
|
||||||
def terminate(_reason, _state) do
|
def terminate(_reason, _state) do
|
||||||
Phoenix.PubSub.unsubscribe(Aprsme.PubSub, "cluster:leadership")
|
Phoenix.PubSub.unsubscribe(Aprsme.PubSub, "cluster:leadership")
|
||||||
|
|
|
||||||
|
|
@ -1878,6 +1878,10 @@ defmodule AprsmeWeb.MapLive.Index do
|
||||||
# Unsubscribe from StreamingPacketsPubSub
|
# Unsubscribe from StreamingPacketsPubSub
|
||||||
Aprsme.StreamingPacketsPubSub.unsubscribe(self())
|
Aprsme.StreamingPacketsPubSub.unsubscribe(self())
|
||||||
|
|
||||||
|
# Unsubscribe from Endpoint/PubSub topics subscribed in mount
|
||||||
|
Endpoint.unsubscribe("aprs_messages")
|
||||||
|
Phoenix.PubSub.unsubscribe(Aprsme.PubSub, "postgres:aprsme_packets")
|
||||||
|
|
||||||
if socket.assigns.buffer_timer, do: Process.cancel_timer(socket.assigns.buffer_timer)
|
if socket.assigns.buffer_timer, do: Process.cancel_timer(socket.assigns.buffer_timer)
|
||||||
# Clean up any pending bounds update timer
|
# Clean up any pending bounds update timer
|
||||||
if socket.assigns[:bounds_update_timer] do
|
if socket.assigns[:bounds_update_timer] do
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue