mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-14 08:02:15 +03:00
re-Enable HASURA_GRAPHQL_PG_CONN_LIFETIME by default with a default o…
GitOrigin-RevId: 192fc4b80c6bf359334f013af87e20d7de9598ce
This commit is contained in:
parent
52c2b0384e
commit
17dc201fef
@ -36,6 +36,7 @@ In the future, we will probably offer a way to explicitly choose which behaviour
|
||||
|
||||
(Add entries here in the order of: server, console, cli, docs, others)
|
||||
|
||||
- server: re-enable a default HASURA_GRAPHQL_PG_CONN_LIFETIME of 10min
|
||||
- server: support for bigquery datasets
|
||||
- console: add custom_column_names to track_table request with replaced invalid characters (#992)
|
||||
- console: add details button to the success notification to see inserted row
|
||||
|
@ -257,7 +257,10 @@ mkServeOptions rso = do
|
||||
-- hard throughput cap at 1000RPS when db queries take 50ms on average:
|
||||
conns <- fromMaybe 50 <$> withEnv c (fst pgConnsEnv)
|
||||
iTime <- fromMaybe 180 <$> withEnv i (fst pgTimeoutEnv)
|
||||
connLifetime <- withEnv cl (fst pgConnLifetimeEnv)
|
||||
connLifetime <- withEnv cl (fst pgConnLifetimeEnv) <&> \case
|
||||
Nothing -> Just 600 -- Not set by user; use the default timeout
|
||||
Just 0 -> Nothing -- user wants to disable PG_CONN_LIFETIME
|
||||
Just n -> Just n -- user specified n seconds lifetime
|
||||
allowPrepare <- fromMaybe True <$> withEnv p (fst pgUsePrepareEnv)
|
||||
poolTimeout <- withEnv pt (fst pgPoolTimeoutEnv)
|
||||
return $ Q.ConnParams
|
||||
@ -488,7 +491,8 @@ pgConnLifetimeEnv :: (String, String)
|
||||
pgConnLifetimeEnv =
|
||||
( "HASURA_GRAPHQL_PG_CONN_LIFETIME"
|
||||
, "Time from connection creation after which the connection should be destroyed and a new one "
|
||||
<> "created. (default: none)"
|
||||
<> "created. A value of 0 indicates we should never destroy an active connection. If 0 is "
|
||||
<> "passed, memory from large query results may not be reclaimed. (default: 600 sec)"
|
||||
)
|
||||
|
||||
pgPoolTimeoutEnv :: (String, String)
|
||||
|
Loading…
Reference in New Issue
Block a user