From 00dc52a6dcea99c7dc65fba5d397d085776bb9bd Mon Sep 17 00:00:00 2001 From: stuebinm Date: Wed, 15 May 2024 01:15:54 +0200 Subject: 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. --- lib/Server/GTFS_RT.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) -- cgit v1.2.3