Skip to content

Commit

Permalink
periodic-server: update psql pool maxResources
Browse files Browse the repository at this point in the history
  • Loading branch information
Lupino committed Jul 3, 2024
1 parent 25fe6ba commit 98abc0c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions periodic-server/src/Periodic/Server/Persist/PSQL.hs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ module Periodic.Server.Persist.PSQL
) where


import Control.Concurrent (getNumCapabilities)
import Control.Monad (void)
import Data.Binary (decodeOrFail)
import Data.Byteable (toBytes)
Expand Down Expand Up @@ -58,9 +59,7 @@ instance ToField Job where

newtype PSQL = PSQL PSQLPool

numStripes = Just 1
idleTime = 10
maxResources = 10

runDB :: PSQL -> DB.PSQL a -> IO a
runDB (PSQL pool) = runPSQLPool "" pool
Expand All @@ -74,7 +73,8 @@ instance Persist PSQL where

newPersist (PSQLPath path) = do
infoM "Periodic.Server.Persist.PSQL" ("PSQL connected " ++ show path)
pool <- createPSQLPool path numStripes idleTime maxResources
maxResources <- (*2) <$> getNumCapabilities
pool <- createPSQLPool path Nothing idleTime maxResources
runPSQLPool "" pool $ withTransaction $ do
void createConfigTable
void createJobTable
Expand Down

0 comments on commit 98abc0c

Please sign in to comment.