feat: use hasql-pool-0.10, add db-pool-max-idletime (#2786)

- new option db-pool-max-idletime limits the maximal idle time of a
  postgresql connection, defaults to 30 seconds
- this essentially restores the db-pool-timeout option from versions
  <=10, with more specific name
This commit is contained in:
Robert
2023-05-16 23:00:40 +02:00
committed by GitHub
parent a867d79c42
commit f9f0f79fa9
20 changed files with 41 additions and 16 deletions
+1
View File
@@ -7,6 +7,7 @@ db-plan-enabled = false
db-pool = 10
db-pool-acquisition-timeout = 10
db-pool-max-lifetime = 1800
db-pool-max-idletime = 30
db-pre-request = "check_alias"
db-prepared-statements = true
db-root-spec = "open_alias"
@@ -7,6 +7,7 @@ db-plan-enabled = false
db-pool = 10
db-pool-acquisition-timeout = 10
db-pool-max-lifetime = 1800
db-pool-max-idletime = 30
db-pre-request = ""
db-prepared-statements = false
db-root-spec = ""
@@ -7,6 +7,7 @@ db-plan-enabled = false
db-pool = 10
db-pool-acquisition-timeout = 10
db-pool-max-lifetime = 1800
db-pool-max-idletime = 30
db-pre-request = ""
db-prepared-statements = false
db-root-spec = ""
+1
View File
@@ -7,6 +7,7 @@ db-plan-enabled = false
db-pool = 10
db-pool-acquisition-timeout = 10
db-pool-max-lifetime = 1800
db-pool-max-idletime = 30
db-pre-request = ""
db-prepared-statements = true
db-root-spec = ""
@@ -7,6 +7,7 @@ db-plan-enabled = true
db-pool = 1
db-pool-acquisition-timeout = 30
db-pool-max-lifetime = 3600
db-pool-max-idletime = 60
db-pre-request = "test.other_custom_headers"
db-prepared-statements = false
db-root-spec = "other_root"
@@ -7,6 +7,7 @@ db-plan-enabled = true
db-pool = 1
db-pool-acquisition-timeout = 30
db-pool-max-lifetime = 3600
db-pool-max-idletime = 60
db-pre-request = "test.custom_headers"
db-prepared-statements = false
db-root-spec = "root"
@@ -7,6 +7,7 @@ db-plan-enabled = true
db-pool = 1
db-pool-acquisition-timeout = 30
db-pool-max-lifetime = 3600
db-pool-max-idletime = 60
db-pre-request = "please_run_fast"
db-prepared-statements = false
db-root-spec = "openapi_v3"
+1
View File
@@ -7,6 +7,7 @@ db-plan-enabled = false
db-pool = 10
db-pool-acquisition-timeout = 10
db-pool-max-lifetime = 1800
db-pool-max-idletime = 30
db-pre-request = ""
db-prepared-statements = true
db-root-spec = ""
+1
View File
@@ -9,6 +9,7 @@ PGRST_DB_PLAN_ENABLED: true
PGRST_DB_POOL: 1
PGRST_DB_POOL_ACQUISITION_TIMEOUT: 30
PGRST_DB_POOL_MAX_LIFETIME: 3600
PGRST_DB_POOL_MAX_IDLETIME: 60
PGRST_DB_PREPARED_STATEMENTS: false
PGRST_DB_PRE_REQUEST: please_run_fast
PGRST_DB_ROOT_SPEC: openapi_v3
+1
View File
@@ -7,6 +7,7 @@ db-plan-enabled = true
db-pool = 1
db-pool-acquisition-timeout = 30
db-pool-max-lifetime = 3600
db-pool-max-idletime = 60
db-pre-request = "please_run_fast"
db-prepared-statements = false
db-root-spec = "openapi_v3"
+1 -1
View File
@@ -66,7 +66,7 @@ import qualified Feature.RpcPreRequestGucsSpec
main :: IO ()
main = do
pool <- P.acquire 3 10 60 $ toUtf8 $ configDbUri testCfg
pool <- P.acquire 3 10 60 60 $ toUtf8 $ configDbUri testCfg
actualPgVersion <- either (panic . show) id <$> P.use pool (queryPgVersion False)
+1
View File
@@ -84,6 +84,7 @@ baseCfg = let secret = Just $ encodeUtf8 "reallyreallyreallyreallyverysafe" in
, configDbPoolSize = 10
, configDbPoolAcquisitionTimeout = 10
, configDbPoolMaxLifetime = 1800
, configDbPoolMaxIdletime = 600
, configDbPreRequest = Just $ QualifiedIdentifier "test" "switch_role"
, configDbPreparedStatements = True
, configDbRootSpec = Nothing