Change admin health endpoint to ready

This commit is contained in:
steve-chavez
2022-01-04 20:12:52 -05:00
committed by Steve Chavez
parent bba6e96fd3
commit 65a3ae08f0
5 changed files with 15 additions and 14 deletions
+1 -1
View File
@@ -24,7 +24,7 @@ postgrestAdmin appState appConfig req respond = do
isMainAppReachable <- isRight <$> reachMainApp appConfig
case Wai.pathInfo req of
["health"] ->
["ready"] ->
if configDbChannelEnabled appConfig then do
listenerOn <- AppState.getIsListenerOn appState
respond $ Wai.responseLBS (if listenerOn && isMainAppReachable then HTTP.status200 else HTTP.status503) [] mempty
+1 -1
View File
@@ -55,7 +55,7 @@ data AppState = AppState
, stateIsWorkerOn :: IORef Bool
-- | Binary semaphore used to sync the listener(NOTIFY reload) with the connectionWorker.
, stateListener :: MVar ()
-- | State of the LISTEN channel, used for health checks
-- | State of the LISTEN channel, used for the admin server checks
, stateIsListenerOn :: IORef Bool
-- | Config that can change at runtime
, stateConf :: IORef AppConfig
+1 -1
View File
@@ -199,7 +199,7 @@ exampleConfigFile =
|## when none is provided, 660 is applied by default
|# server-unix-socket-mode = "660"
|
|## admin server for health checks, it's disabled by default unless a port is specified
|## admin server used for checks, it's disabled by default unless a port is specified
|# admin-server-port = 3001
|
|## determine if the OpenAPI output should follow or ignore role privileges or be disabled entirely