Skip to content

Commit

Permalink
log some boarding prediction details
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulJKim committed Aug 7, 2024
1 parent c0a4be8 commit a30a177
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions lib/content/message/predictions.ex
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,26 @@ defmodule Content.Message.Predictions do
def terminal(prediction, station_code, zone, sign, width) do
stopped_at? = prediction.stops_away == 0

if stopped_at? and
prediction.seconds_until_departure + @terminal_prediction_offset_seconds <=
@terminal_brd_seconds do
Logger.info([
"prediction_info: ",
"trip_id=",
prediction.trip_id,
" stop_id=",
prediction.stop_id,
" vehicle_id=",
prediction.vehicle_id,
" direction_id=",
prediction.direction_id,
" seconds_until_departure=",
prediction.seconds_until_departure,
" boarding_status=",
prediction.boarding_status
])
end

{minutes, approximate?} =
case prediction.seconds_until_departure + @terminal_prediction_offset_seconds do
x when x <= @terminal_brd_seconds and stopped_at? -> {:boarding, false}
Expand Down

0 comments on commit a30a177

Please sign in to comment.