refactor: remove pgVersion from DbStructure

Also use a dedicated MVar for listener
This commit is contained in:
steve-chavez
2021-04-30 10:06:07 -05:00
committed by Steve Chavez
parent 0f6a13191c
commit 082c91c855
6 changed files with 66 additions and 53 deletions
+2 -4
View File
@@ -20,7 +20,7 @@ import Text.Heredoc (str)
import PostgREST.AppState (AppState)
import PostgREST.Config (AppConfig (..))
import PostgREST.DbStructure (getDbStructure, getPgVersion)
import PostgREST.DbStructure (getDbStructure)
import PostgREST.Version (prettyVersion)
import PostgREST.Workers (reReadConfig)
@@ -54,13 +54,11 @@ dumpSchema :: AppState -> IO LBS.ByteString
dumpSchema appState = do
AppConfig{..} <- AppState.getConfig appState
result <-
P.use (AppState.getPool appState) $ do
pgVersion <- getPgVersion
P.use (AppState.getPool appState) $
HT.transaction HT.ReadCommitted HT.Read $
getDbStructure
(toList configDbSchemas)
configDbExtraSearchPath
pgVersion
configDbPreparedStatements
P.release $ AppState.getPool appState
case result of