fix: Panic when attempting to run with unix socket on non-unix host

This commit is contained in:
monacoremo
2021-04-24 19:42:58 +02:00
committed by Remo Rechkemmer
parent 59f0fe5b32
commit 63e0292e23
4 changed files with 17 additions and 13 deletions
+3 -3
View File
@@ -1,5 +1,5 @@
module PostgREST.Unix
( runAppInSocket
( runAppWithSocket
, installSignalHandlers
) where
@@ -20,8 +20,8 @@ import Protolude
-- | Run the PostgREST application with user defined socket.
runAppInSocket :: Warp.Settings -> Application -> FileMode -> FilePath -> IO ()
runAppInSocket settings app socketFileMode socketFilePath =
runAppWithSocket :: Warp.Settings -> Application -> FileMode -> FilePath -> IO ()
runAppWithSocket settings app socketFileMode socketFilePath =
bracket createAndBindSocket Socket.close $ \socket -> do
putStrLn $ ("Listening on unix socket " :: Text) <> show socketFilePath
Socket.listen socket Socket.maxListenQueue