neiam
/apollos_crib
It's Apollo's Crib
public · Issues · Pulls 1 · Labels · Forks · Compare · Actions failure · Badges · Packages
⭐
Log in to mark this repository.
Do not let a missing alerts lookup take a Plus render down
86d2342 · Gabriel Morell · 2026-09-02 17:42
Message
{commit_body(@commit)}
Files changed
modified
apps/room_sanctum/lib/room_sanctum/condensers/plus_mqtt.ex
+15
−1
@@ -96,7 +96,7 @@ defmodule RoomSanctum.Condenser.PlusMQTT do
| 96 | 96 | defp attach_alerts(routes, id, stop) do |
| 97 | 97 | route_ids = routes |> Enum.map(& &1.route) |> Enum.uniq() |
| 98 | 98 | |
| 99 | − case RoomGtfs.Worker.query_alerts(id, stop, route_ids) do | |
| 99 | + case alerts_for(id, stop, route_ids) do | |
| 100 | 100 | [] -> |
| 101 | 101 | routes |
| 102 | 102 |
@@ -111,6 +111,20 @@ defmodule RoomSanctum.Condenser.PlusMQTT do
| 111 | 111 | end |
| 112 | 112 | end |
| 113 | 113 | |
| 114 | + # room_sanctum does not declare a dependency on room_gtfs -- the two only meet | |
| 115 | + # in the release -- so this is a call into a module that is present in | |
| 116 | + # production and absent anywhere the umbrella is loaded piecemeal. It also | |
| 117 | + # reaches a Registry that a shutting-down node has already stopped. Neither | |
| 118 | + # is a reason to take a page render down over a decoration. | |
| 119 | + defp alerts_for(id, stop, route_ids) do | |
| 120 | + RoomGtfs.Worker.query_alerts(id, stop, route_ids) | |
| 121 | + rescue | |
| 122 | + UndefinedFunctionError -> [] | |
| 123 | + ArgumentError -> [] | |
| 124 | + catch | |
| 125 | + :exit, _ -> [] | |
| 126 | + end | |
| 127 | + | |
| 114 | 128 | defp stop_of(data) do |
| 115 | 129 | data |> Enum.find_value(&Map.get(&1, :stop_id)) |
| 116 | 130 | end |
Parents: fe3bfd7