aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--lib/Server/GTFS_RT.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Server/GTFS_RT.hs b/lib/Server/GTFS_RT.hs
index d2e53a1..236f4cc 100644
--- a/lib/Server/GTFS_RT.hs
+++ b/lib/Server/GTFS_RT.hs
@@ -99,7 +99,7 @@ gtfsRealtimeServer gtfs@GTFS{..} dbpool =
today <- liftIO $ getCurrentTime <&> utctDay
nowSeconds <- secondsNow today
-- let running = M.toList (tripsOnDay gtfs today)
- tickets <- selectList [TicketCompleted ==. False] [Asc TicketTripName]
+ tickets <- selectList [TicketCompleted ==. False, TicketDay ==. today] [Asc TicketTripName]
tripUpdates <- forM tickets $ \(Entity key Ticket{..}) -> do
selectList [TrainAnchorTicket ==. key] [] >>= \a -> case nonEmpty a of
@@ -117,7 +117,7 @@ gtfsRealtimeServer gtfs@GTFS{..} dbpool =
let stillRunning = trainAnchorDelay lastAnchor + toSeconds (stopArrival lastStop) tzseries today
< nowSeconds + 5 * 60
- pure $ Just $ defMessage
+ pure $ if not stillRunning then Nothing else Just $ defMessage
& RT.id .~ UUID.toText (coerce key)
& RT.tripUpdate .~ (defMessage
& RT.trip .~