Skip to content

Commit

Permalink
log empty headsigns (#1929)
Browse files Browse the repository at this point in the history
  • Loading branch information
anthonyshull authored Mar 19, 2024
1 parent 4b639be commit 6518b71
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/dotcom_web/controllers/schedule/line_api.ex
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ defmodule DotcomWeb.ScheduleController.LineApi do
Provides JSON endpoints for retrieving line diagram data.
"""

require Logger

use DotcomWeb, :controller
use Nebulex.Caching.Decorators

Expand Down Expand Up @@ -106,6 +108,10 @@ defmodule DotcomWeb.ScheduleController.LineApi do
now: now
)

if Map.keys(headsigns_by_stop) == [] do
Logger.warning("No headsigns for route #{route_id} and direction #{direction_id}")
end

tooltips_by_stop =
tooltips
|> Map.values()
Expand All @@ -116,6 +122,10 @@ defmodule DotcomWeb.ScheduleController.LineApi do
|> Stream.concat(Map.keys(tooltips_by_stop))
|> Stream.uniq()
|> Stream.map(fn stop_id ->
if Map.get(headsigns_by_stop, stop_id) == nil do
Logger.warning("No headsigns for stop #{stop_id} on route #{route_id}")
end

{stop_id,
%{
headsigns: Map.get(headsigns_by_stop, stop_id, []),
Expand Down

0 comments on commit 6518b71

Please sign in to comment.