Skip to content

Commit

Permalink
Merge pull request #1960 from digitallyinduced/fix-1959
Browse files Browse the repository at this point in the history
Set db connection pool max connections to aleast the value of getNumCapabilities
  • Loading branch information
mpscholten authored May 9, 2024
2 parents 38d9e58 + 4ece29c commit 4d4a7ef
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion IHP/FrameworkConfig.hs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ import IHP.EnvVar
import qualified Prelude
import qualified GHC.Stack as Stack

import qualified Control.Concurrent as Concurrent

newtype AppHostname = AppHostname Text
newtype AppPort = AppPort Int
newtype BaseUrl = BaseUrl Text
Expand Down Expand Up @@ -154,7 +156,11 @@ ihpDefaultConfig = do
case environment of
Development -> 2
Production -> 60
option $ DBPoolMaxConnections 20

-- poolMaxResources must not be smaller than numStripes
-- https://github.com/digitallyinduced/ihp/issues/1959
numCapabilities <- configIO Concurrent.getNumCapabilities
option $ DBPoolMaxConnections (max numCapabilities 20)

(AppPort port) <- findOption @AppPort

Expand Down

0 comments on commit 4d4a7ef

Please sign in to comment.