Skip to content

Commit

Permalink
wip: add logging to shuttle groupfilter
Browse files Browse the repository at this point in the history
  • Loading branch information
bklebe committed Jun 27, 2024
1 parent 98bfd9a commit c8487e4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/concentrate/group_filter/shuttle.ex
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ defmodule Concentrate.GroupFilter.Shuttle do
"""
@behaviour Concentrate.GroupFilter
alias Concentrate.{StopTimeUpdate, TripDescriptor}
require Logger

@impl Concentrate.GroupFilter
def filter(trip_group, shuttle_module \\ Concentrate.Filter.Alert.Shuttles)
Expand Down Expand Up @@ -49,15 +50,19 @@ defmodule Concentrate.GroupFilter.Shuttle do

case module.stop_shuttling_on_route(route_id, stop_id, time) do
nil ->
Logger.info("modifying_shuttle_stop (nil) stu=#{inspect(stu.stop_id, limit: :infinity)}")
drop_arrival_time_if_after_shuttle(stu, has_shuttled?)

:through ->
Logger.info("modifying_shuttle_stop (through) stu=#{inspect(stu.stop_id, limit: :infinity)}")
{[StopTimeUpdate.skip(stu)], {has_started?, true}}

:start ->
Logger.info("modifying_shuttle_stop (start) stu=#{inspect(stu.stop_id, limit: :infinity)}")
{[StopTimeUpdate.update_departure_time(stu, nil)], {true, true}}

:stop ->
Logger.info("modifying_shuttle_stop (stop) stu=#{inspect(stu.stop_id, limit: :infinity)}")
{[StopTimeUpdate.update_arrival_time(stu, nil)], {false, false}}
end
else
Expand Down

0 comments on commit c8487e4

Please sign in to comment.