Logging and really not working light restoration
This commit is contained in:
1 parent
1098be227d
commit
c75fc1a7b9
10 files changed
+180
-151
No files matched your search
@@ -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
|
||||
|
||||
Reference in new issue
Block a user