Consider schema cache state on the ready check

* empty schema cache when it fails loading so the ready check can pick
  its new state
This commit is contained in:
steve-chavez
2022-01-07 09:31:30 +01:00
committed by Wolfgang Walther
parent e13d912a79
commit aa82d2e277
7 changed files with 52 additions and 17 deletions
+2 -2
View File
@@ -76,7 +76,7 @@ main = do
let config = cfg testDbConn
appState <- AppState.initWithPool pool config
AppState.putPgVersion appState actualPgVersion
AppState.putDbStructure appState baseDbStructure
AppState.putDbStructure appState (Just baseDbStructure)
when (isJust $ configDbRootSpec config) $
AppState.putJsonDbS appState $ toS $ JSON.encode baseDbStructure
return ((), postgrest LogCrit appState $ pure ())
@@ -91,7 +91,7 @@ main = do
actualPgVersion
appState <- AppState.initWithPool pool config
AppState.putPgVersion appState actualPgVersion
AppState.putDbStructure appState customDbStructure
AppState.putDbStructure appState (Just customDbStructure)
when (isJust $ configDbRootSpec config) $
AppState.putJsonDbS appState $ toS $ JSON.encode baseDbStructure
return ((), postgrest LogCrit appState $ pure ())