From efd28a2d5a5b481b5d794bd8af28d6350f85250d Mon Sep 17 00:00:00 2001 From: Fumiaki Kinoshita Date: Mon, 20 Feb 2023 16:49:04 +0900 Subject: [PATCH] support resource-pool-0.4 --- cabal.project | 6 ------ herp-logger.cabal | 2 +- src/Herp/Logger.hs | 3 +-- 3 files changed, 2 insertions(+), 9 deletions(-) diff --git a/cabal.project b/cabal.project index 437aa8f..1b8a75e 100644 --- a/cabal.project +++ b/cabal.project @@ -1,8 +1,2 @@ packages: . - -source-repository-package - type: git - location: https://github.com/MercuryTechnologies/pool.git - tag: 1aa551e41e3527ce23f38251567507df5357fdb9 - diff --git a/herp-logger.cabal b/herp-logger.cabal index 3cfef87..002f938 100644 --- a/herp-logger.cabal +++ b/herp-logger.cabal @@ -79,7 +79,7 @@ library , monad-logger , mtl , pretty-simple - , resource-pool ^>= 0.3 + , resource-pool ^>= 0.4 , safe-exceptions , stm , text diff --git a/src/Herp/Logger.hs b/src/Herp/Logger.hs index 697bf09..9c658d0 100644 --- a/src/Herp/Logger.hs +++ b/src/Herp/Logger.hs @@ -91,8 +91,7 @@ mkThreadPool poolMaxResources errHandler = do atomically (flushTQueue queue) >>= sequence_ cancel thread let poolCacheTTL = 3600 - let poolNumStripes = Just 1 - pool <- newPool PoolConfig{..} + pool <- newPool $ setNumStripes (Just 1) $ defaultPoolConfig createResource freeResource poolCacheTTL poolMaxResources pure pool -- NOTE: It *blocks* when there are no threads in idle.