fix: schema cache retrying without backoff
Fixes https://github.com/PostgREST/postgrest/issues/3523. Now if there's a failure when obtaining the pg version OR schema cache, we do the same retrying process. This way we don't add two retries. Refactors and renames the "connectionWorker" to "schemaCacheLoader". This makes more sense since what we really want is the schema cache, the version is the pre-requisite for ensuring our schema cache queries work. Additionally, we no longer log ` Attempting to connect to the database...` at startup unnecessarily. This is only logged whenever there's a retry attempt.
This commit is contained in:
@@ -42,10 +42,10 @@ main CLI{cliCommand, cliPath} = do
|
||||
AppState.destroy
|
||||
(\appState -> case cliCommand of
|
||||
CmdDumpConfig -> do
|
||||
when configDbConfig $ AppState.reReadConfig True appState
|
||||
when configDbConfig $ AppState.readInDbConfig True appState
|
||||
putStr . Config.toText =<< AppState.getConfig appState
|
||||
CmdDumpSchema -> do
|
||||
when configDbConfig $ AppState.reReadConfig True appState
|
||||
when configDbConfig $ AppState.readInDbConfig True appState
|
||||
putStrLn =<< dumpSchema appState
|
||||
CmdRun -> App.run appState)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user