diff options
author | stuebinm | 2022-07-02 17:34:29 +0200 |
---|---|---|
committer | stuebinm | 2022-07-02 17:36:04 +0200 |
commit | 84a620a47bd23d5d0f93ae6c7abe5d622005044d (patch) | |
tree | 36eb8082ce4b36057ef86b25d4694ab5c5818f72 /lib/Server.hs | |
parent | aeeaf83cf0dc72e9e39439984067563d08e57dec (diff) |
gtfs realtime: add vehicle positions
(or at least something that looks like it might be correct — though
it carries very little information, and lacks things like what the next
stop along the route is)
Diffstat (limited to 'lib/Server.hs')
-rw-r--r-- | lib/Server.hs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Server.hs b/lib/Server.hs index 6c293f0..5ece540 100644 --- a/lib/Server.hs +++ b/lib/Server.hs @@ -91,8 +91,9 @@ server gtfs@GTFS{..} dbpool = handleDebugAPI :<|> handleStations :<|> handleTime Just res -> pure res Nothing -> throwError err404 handleRegister tripID = do + -- TODO registration may carry extra information! expires <- liftIO $ getCurrentTime <&> addUTCTime validityPeriod - RunningTripKey token <- runSql dbpool $ insert (RunningTrip expires False tripID) + RunningTripKey token <- runSql dbpool $ insert (RunningTrip expires False tripID Nothing) pure token handleTripPing ping = do checkTokenValid dbpool (coerce $ tripPingToken ping) |