Configurable poolsize, longer timeout

This commit is contained in:
Michael Snoyman 2020-07-07 13:58:55 +03:00
parent 3393217f66
commit 0823066401
No known key found for this signature in database
GPG Key ID: 907EAE2F42B52046
4 changed files with 8 additions and 1 deletions

View File

@ -23,3 +23,4 @@ force-ssl: false
# dev-download: false
postgres-string: "_env:PGSTRING:host=localhost port=5432 user=stackage dbname=stackage password=stackage"
postgres-poolsize: "_env:PGPOOLSIZE:8"

View File

@ -140,7 +140,7 @@ withFoundation appLogFunc appSettings inner = do
gitRepoDev fp loadWebsiteContent
else gitRepo "https://github.com/fpco/stackage-content.git" "master" loadWebsiteContent
let pgConf =
PostgresConf {pgPoolSize = 2, pgConnStr = encodeUtf8 $ appPostgresString appSettings}
PostgresConf {pgPoolSize = appPostgresPoolsize appSettings, pgConnStr = encodeUtf8 $ appPostgresString appSettings}
-- Temporary workaround to force content updates regularly, until
-- distribution of webhooks is handled via consul
runContentUpdates =

View File

@ -39,6 +39,8 @@ data AppSettings = AppSettings
-- behind a reverse proxy.
, appPostgresString :: !Text
-- ^ PostgreSQL connection string
, appPostgresPoolsize :: !Int
-- ^ PostgreSQL poolsize
, appDetailedRequestLogging :: Bool
-- ^ Use detailed request logging system
@ -71,6 +73,7 @@ instance FromJSON AppSettings where
appPort <- o .: "port"
appIpFromHeader <- o .: "ip-from-header"
appPostgresString <- o .: "postgres-string"
appPostgresPoolsize <- o .: "postgres-poolsize"
dev <- o .:? "development" .!= defaultDev

View File

@ -13,6 +13,9 @@ extra-deps:
subdirs:
- casa-client
- casa-types
- github: yesodweb/persistent
commit: f66ed6f472ff3faa140db37bf4649e5b80be4c57
subdirs: [persistent]
drop-packages:
- Cabal