aboutsummaryrefslogtreecommitdiff
path: root/lib/Server/Subscribe.hs
diff options
context:
space:
mode:
authorstuebinm2026-04-16 01:23:50 +0200
committerstuebinm2026-04-16 01:23:50 +0200
commit5f27e441f47f2565b941b321a9939d54357e1654 (patch)
tree86e18ad5ef53b2941fbabd7568006f0dc9b8d1bd /lib/Server/Subscribe.hs
parentfbfa662922a2dcf34e8a2cf1eb020210de18c0af (diff)
meta: reorganisation, rename "token" to "trackerId"
Diffstat (limited to '')
-rw-r--r--lib/Server/Subscribe.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Server/Subscribe.hs b/lib/Server/Subscribe.hs
index 8559659..5b0edb5 100644
--- a/lib/Server/Subscribe.hs
+++ b/lib/Server/Subscribe.hs
@@ -37,9 +37,9 @@ handleSubscribe dbpool subscribers (ticketId :: UUID) conn = liftIO $ WS.withPin
-- send most recent ping, if any (so we won't have to wait for movement)
runSqlWithoutLog dbpool (selectOne do
- ping <- from (table @TrainPing)
- where_ (ping ^. TrainPingTicket ==. val (coerce ticketId))
- orderBy [desc (ping ^. TrainPingTimestamp)]
+ ping <- from (table @Ping)
+ where_ (ping ^. PingTicket ==. val (Just (coerce ticketId)))
+ orderBy [desc (ping ^. PingTimestamp)]
pure ping)
<&> fmap entityVal
>>= flip whenJust (WS.sendTextData conn . A.encode)