aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstuebinm2024-05-15 01:15:54 +0200
committerstuebinm2024-05-15 01:15:54 +0200
commit00dc52a6dcea99c7dc65fba5d397d085776bb9bd (patch)
tree6d8ee7f0ba19e82958ac4eb22931ccbbabecde06
parent6e257141cdf43730a04bf570887ddca031f9c1aa (diff)
Server.GtfsRealtime: bugfix
can't believe it was this simple … but seems to be all that was wrong. Tracktrain should now automatically remove tripUpdates for tickets whose trip has ended more than five minutes ago (taking delay into account). Nothing in the gtfs-rt spec says you should do this, but google likes to complain if one doesn't do this.
-rw-r--r--lib/Server/GTFS_RT.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Server/GTFS_RT.hs b/lib/Server/GTFS_RT.hs
index 236f4cc..9c52e9c 100644
--- a/lib/Server/GTFS_RT.hs
+++ b/lib/Server/GTFS_RT.hs
@@ -115,7 +115,7 @@ gtfsRealtimeServer gtfs@GTFS{..} dbpool =
(, stop, station) <$> extrapolateAtPosition LinearExtrapolator anchorEntities (int2Double (stopSequence stop))
let (lastAnchor, lastStop, lastStation) = last (catMaybes atStations)
let stillRunning = trainAnchorDelay lastAnchor + toSeconds (stopArrival lastStop) tzseries today
- < nowSeconds + 5 * 60
+ > nowSeconds + 5 * 60
pure $ if not stillRunning then Nothing else Just $ defMessage
& RT.id .~ UUID.toText (coerce key)