From 82355e81aa9a3fd7a38f902dc749d4835270ab21 Mon Sep 17 00:00:00 2001 From: stuebinm Date: Sun, 19 May 2024 16:02:46 +0200 Subject: Server.Ingest: bugfix (tentative) --- lib/Server/Ingest.hs | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/Server/Ingest.hs b/lib/Server/Ingest.hs index 6a8383f..959a4c6 100644 --- a/lib/Server/Ingest.hs +++ b/lib/Server/Ingest.hs @@ -87,18 +87,18 @@ handleTrainPing dbpool subscribers cfg onError ping@SentPing{..} = Nothing -> onError >> pure Nothing Just tracker@Tracker{..} -> do - unless (serverConfigDebugMode cfg) $ do - now <- liftIO getCurrentTime - let timeDiff = sentPingTimestamp `diffUTCTime` now - when (utctDay sentPingTimestamp /= utctDay now) $ do - logErrorN "received ping for wrong day" - throw err400 - when (timeDiff < 10) $ do - logWarnN "received ping more than 10 seconds out of date" - throw err400 - when (timeDiff > 10) $ do - logWarnN "received ping from more than 10 seconds in the future" - throw err400 + -- unless (serverConfigDebugMode cfg) $ do + -- now <- liftIO getCurrentTime + -- let timeDiff = sentPingTimestamp `diffUTCTime` now + -- when (utctDay sentPingTimestamp /= utctDay now) $ do + -- logErrorN "received ping for wrong day" + -- throw err400 + -- when (timeDiff < 10) $ do + -- logWarnN "received ping more than 10 seconds out of date" + -- throw err400 + -- when (timeDiff > 10) $ do + -- logWarnN "received ping from more than 10 seconds in the future" + -- throw err400 ticketId <- case trackerCurrentTicket of Just ticketId -> pure ticketId -- cgit v1.2.3