refactor: introduce AppState.usePool

This commit is contained in:
Robert Vollmert
2022-08-02 09:24:14 +02:00
committed by Robert
parent d53949e4a4
commit 401b98c5b4
4 changed files with 11 additions and 10 deletions
+1 -2
View File
@@ -11,7 +11,6 @@ import Network.Socket.ByteString
import qualified Network.HTTP.Types.Status as HTTP
import qualified Network.Wai as Wai
import qualified Hasql.Pool as SQL
import qualified Hasql.Session as SQL
import qualified PostgREST.AppState as AppState
@@ -27,7 +26,7 @@ postgrestAdmin appState appConfig req respond = do
isConnectionUp <-
if configDbChannelEnabled appConfig
then AppState.getIsListenerOn appState
else isRight <$> SQL.use (AppState.getPool appState) (SQL.sql "SELECT 1")
else isRight <$> AppState.usePool appState (SQL.sql "SELECT 1")
case Wai.pathInfo req of
["ready"] ->