Add live endpoint to admin server

* refactor io tests
* add network package to windows
This commit is contained in:
steve-chavez
2022-01-04 20:12:52 -05:00
committed by Steve Chavez
parent 65a3ae08f0
commit 4a9ca9bdae
4 changed files with 28 additions and 13 deletions
+4 -1
View File
@@ -31,7 +31,10 @@ postgrestAdmin appState appConfig req respond = do
else do
result <- SQL.use (AppState.getPool appState) $ SQL.sql "SELECT 1"
respond $ Wai.responseLBS (if isRight result && isMainAppReachable then HTTP.status200 else HTTP.status503) [] mempty
_ -> respond $ Wai.responseLBS HTTP.status404 [] mempty
["live"] ->
respond $ Wai.responseLBS (if isMainAppReachable then HTTP.status200 else HTTP.status503) [] mempty
_ ->
respond $ Wai.responseLBS HTTP.status404 [] mempty
-- Try to connect to the main app socket
-- Note that it doesn't even send a valid HTTP request, we just want to check that the main app is accepting connections