diff options
author | stuebinm | 2024-05-19 16:02:46 +0200 |
---|---|---|
committer | stuebinm | 2024-05-19 18:05:57 +0200 |
commit | 82355e81aa9a3fd7a38f902dc749d4835270ab21 (patch) | |
tree | 51c1e05f88f882a273602b0016a79a1d7c230927 /lib | |
parent | 7aeb39861887bd76ba35e5cf5222ddf08df68045 (diff) |
Server.Ingest: bugfix (tentative)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Server/Ingest.hs | 24 |
1 files 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 |