diff --git a/lib/aprs/release.ex b/lib/aprs/release.ex index be87f3c..8ec18f7 100644 --- a/lib/aprs/release.ex +++ b/lib/aprs/release.ex @@ -6,9 +6,9 @@ defmodule Aprs.Release do @app :aprs def migrate do + require Logger # Initialize deployment timestamp first deployed_at = init() - require Logger Logger.info("Deployment timestamp: #{deployed_at}") # Run migrations @@ -20,10 +20,6 @@ defmodule Aprs.Release do {:ok, _, _} = Ecto.Migrator.with_repo(repo, &Ecto.Migrator.run(&1, :down, to: version)) end - defp repos do - Application.fetch_env!(@app, :ecto_repos) - end - defp load_app do Application.load(@app) end diff --git a/lib/aprs_web/live/map_live/index.ex b/lib/aprs_web/live/map_live/index.ex index b62f2a1..dc14e4e 100644 --- a/lib/aprs_web/live/map_live/index.ex +++ b/lib/aprs_web/live/map_live/index.ex @@ -143,18 +143,14 @@ defmodule AprsWeb.MapLive.Index do @impl true def handle_event("bounds_changed", %{"bounds" => bounds}, socket) do - Logger.debug( - "handle_event bounds_changed: #{inspect(bounds)} vs current #{inspect(socket.assigns.map_bounds)}" - ) + Logger.debug("handle_event bounds_changed: #{inspect(bounds)} vs current #{inspect(socket.assigns.map_bounds)}") handle_bounds_update(bounds, socket) end @impl true def handle_event("update_bounds", %{"bounds" => bounds}, socket) do - Logger.debug( - "handle_event update_bounds: #{inspect(bounds)} vs current #{inspect(socket.assigns.map_bounds)}" - ) + Logger.debug("handle_event update_bounds: #{inspect(bounds)} vs current #{inspect(socket.assigns.map_bounds)}") handle_bounds_update(bounds, socket) end @@ -318,9 +314,7 @@ defmodule AprsWeb.MapLive.Index do west: bounds["west"] } - Logger.debug( - "handle_bounds_update: new #{inspect(map_bounds)} vs current #{inspect(socket.assigns.map_bounds)}" - ) + Logger.debug("handle_bounds_update: new #{inspect(map_bounds)} vs current #{inspect(socket.assigns.map_bounds)}") # Validate bounds to prevent invalid coordinates if map_bounds.north > 90 or map_bounds.south < -90 or @@ -346,9 +340,7 @@ defmodule AprsWeb.MapLive.Index do @spec process_bounds_update(map(), Socket.t()) :: Socket.t() defp process_bounds_update(map_bounds, socket) do - Logger.debug( - "process_bounds_update: Loading historical packets for bounds #{inspect(map_bounds)}" - ) + Logger.debug("process_bounds_update: Loading historical packets for bounds #{inspect(map_bounds)}") # Remove out-of-bounds packets and markers immediately new_visible_packets = @@ -382,30 +374,22 @@ defmodule AprsWeb.MapLive.Index do end @impl true - def handle_info({:process_bounds_update, map_bounds}, socket), - do: handle_info_process_bounds_update(map_bounds, socket) + def handle_info({:process_bounds_update, map_bounds}, socket), do: handle_info_process_bounds_update(map_bounds, socket) - def handle_info({:delayed_zoom, %{lat: lat, lng: lng}}, socket), - do: handle_info_delayed_zoom(lat, lng, socket) + def handle_info({:delayed_zoom, %{lat: lat, lng: lng}}, socket), do: handle_info_delayed_zoom(lat, lng, socket) - def handle_info({:ip_location, %{lat: lat, lng: lng}}, socket), - do: handle_info_ip_location(lat, lng, socket) + def handle_info({:ip_location, %{lat: lat, lng: lng}}, socket), do: handle_info_ip_location(lat, lng, socket) def handle_info(:initialize_replay, socket), do: handle_info_initialize_replay(socket) def handle_info(:cleanup_old_packets, socket), do: handle_cleanup_old_packets(socket) - def handle_info(:reload_historical_packets, socket), - do: handle_reload_historical_packets(socket) + def handle_info(:reload_historical_packets, socket), do: handle_reload_historical_packets(socket) - def handle_info({:postgres_packet, packet}, socket), - do: handle_info_postgres_packet(packet, socket) + def handle_info({:postgres_packet, packet}, socket), do: handle_info_postgres_packet(packet, socket) - def handle_info( - %Phoenix.Socket.Broadcast{topic: "aprs_messages", event: "packet", payload: packet}, - socket - ), - do: handle_info({:postgres_packet, packet}, socket) + def handle_info(%Phoenix.Socket.Broadcast{topic: "aprs_messages", event: "packet", payload: packet}, socket), + do: handle_info({:postgres_packet, packet}, socket) # Private handler functions for each message type @@ -753,7 +737,7 @@ defmodule AprsWeb.MapLive.Index do