Logging and really not working light restoration

This commit is contained in:
MasseR committed 2026-09-30 13:46:16 +03:00
1 parent 1098be227d
commit c75fc1a7b9
10 files changed
+180 -151

No files matched your search

+4 -3
View File
@@ -38,12 +38,13 @@ data RateLimiter = RateLimiter
slidingWindowLimiter
:: RateLimitMetrics
:: MonadIO m
=> RateLimitMetrics
-> NominalDiffTime -- ^ Within how many seconds
-> Int -- ^ How many requests we can make
-> IO RateLimiter
-> m RateLimiter
slidingWindowLimiter metrics timeWindow size = do
window <- newTVarIO []
window <- liftIO $ newTVarIO []
return $ RateLimiter metrics $ \(RateLimited action) -> do
now <- liftIO getPOSIXTime
allowed <- liftIO $ atomically $ do