From b174295bf2943ef7ef6a3cc24c5252ab2dfce0cc Mon Sep 17 00:00:00 2001 From: Taimoor Zaeem Date: Fri, 31 Jul 2026 14:32:46 +0500 Subject: [PATCH] refactor(chore): rename conf to oldConf in readInDbConfig function Signed-off-by: Taimoor Zaeem --- src/library/PostgREST/AppState/Reload.hs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/library/PostgREST/AppState/Reload.hs b/src/library/PostgREST/AppState/Reload.hs index d235bf793..3f42da798 100644 --- a/src/library/PostgREST/AppState/Reload.hs +++ b/src/library/PostgREST/AppState/Reload.hs @@ -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. readInDbConfig :: Bool -> AppState -> IO () readInDbConfig startingUp appState@AppState{stateObserver=observer} = do - conf <- getConfig appState + oldConf <- getConfig appState pgVer <- getPgVersion appState dbSettings <- - if configDbConfig conf then do - qDbSettings <- usePool appState (queryDbSettings (quoteQi <$> configDbPreConfig conf)) + if configDbConfig oldConf then do + qDbSettings <- usePool appState (queryDbSettings (quoteQi <$> configDbPreConfig oldConf)) case qDbSettings of Left e -> do observer $ ConfigReadErrorObs e @@ -162,7 +162,7 @@ readInDbConfig startingUp appState@AppState{stateObserver=observer} = do else pure mempty (roleSettings, roleIsolationLvl) <- - if configDbConfig conf then do + if configDbConfig oldConf then do rSettings <- usePool appState (queryRoleSettings pgVer) case rSettings of Left e -> do @@ -171,7 +171,7 @@ readInDbConfig startingUp appState@AppState{stateObserver=observer} = do Right x -> pure x else pure mempty - readAppConfig dbSettings (configFilePath conf) (Just $ configDbUri conf) roleSettings roleIsolationLvl >>= \case + readAppConfig dbSettings (configFilePath oldConf) (Just $ configDbUri oldConf) roleSettings roleIsolationLvl >>= \case Left err -> if startingUp then panic err -- die on invalid config if the program is starting up