refactor(chore): rename conf to oldConf in readInDbConfig function
Signed-off-by: Taimoor Zaeem <taimoorzaeem@gmail.com>
This commit is contained in:
@@ -149,11 +149,11 @@ waitForSchemaCacheLoaded = atomically . (check <=< readTMVar) . getSCStatusTMVar
|
|||||||
-- | We don't retry reading the in-db config after it fails immediately, because it could have user errors. We just report the error and continue.
|
-- | We don't retry reading the in-db config after it fails immediately, because it could have user errors. We just report the error and continue.
|
||||||
readInDbConfig :: Bool -> AppState -> IO ()
|
readInDbConfig :: Bool -> AppState -> IO ()
|
||||||
readInDbConfig startingUp appState@AppState{stateObserver=observer} = do
|
readInDbConfig startingUp appState@AppState{stateObserver=observer} = do
|
||||||
conf <- getConfig appState
|
oldConf <- getConfig appState
|
||||||
pgVer <- getPgVersion appState
|
pgVer <- getPgVersion appState
|
||||||
dbSettings <-
|
dbSettings <-
|
||||||
if configDbConfig conf then do
|
if configDbConfig oldConf then do
|
||||||
qDbSettings <- usePool appState (queryDbSettings (quoteQi <$> configDbPreConfig conf))
|
qDbSettings <- usePool appState (queryDbSettings (quoteQi <$> configDbPreConfig oldConf))
|
||||||
case qDbSettings of
|
case qDbSettings of
|
||||||
Left e -> do
|
Left e -> do
|
||||||
observer $ ConfigReadErrorObs e
|
observer $ ConfigReadErrorObs e
|
||||||
@@ -162,7 +162,7 @@ readInDbConfig startingUp appState@AppState{stateObserver=observer} = do
|
|||||||
else
|
else
|
||||||
pure mempty
|
pure mempty
|
||||||
(roleSettings, roleIsolationLvl) <-
|
(roleSettings, roleIsolationLvl) <-
|
||||||
if configDbConfig conf then do
|
if configDbConfig oldConf then do
|
||||||
rSettings <- usePool appState (queryRoleSettings pgVer)
|
rSettings <- usePool appState (queryRoleSettings pgVer)
|
||||||
case rSettings of
|
case rSettings of
|
||||||
Left e -> do
|
Left e -> do
|
||||||
@@ -171,7 +171,7 @@ readInDbConfig startingUp appState@AppState{stateObserver=observer} = do
|
|||||||
Right x -> pure x
|
Right x -> pure x
|
||||||
else
|
else
|
||||||
pure mempty
|
pure mempty
|
||||||
readAppConfig dbSettings (configFilePath conf) (Just $ configDbUri conf) roleSettings roleIsolationLvl >>= \case
|
readAppConfig dbSettings (configFilePath oldConf) (Just $ configDbUri oldConf) roleSettings roleIsolationLvl >>= \case
|
||||||
Left err ->
|
Left err ->
|
||||||
if startingUp then
|
if startingUp then
|
||||||
panic err -- die on invalid config if the program is starting up
|
panic err -- die on invalid config if the program is starting up
|
||||||
|
|||||||
Reference in New Issue
Block a user