From faf009aca16ba1e384fd5da2d6306d1379e36de3 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Thu, 13 Apr 2017 19:54:00 +0200 Subject: Support systemd.service notify type --- Application.hs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'Application.hs') diff --git a/Application.hs b/Application.hs index aa9422f..46dc4c1 100644 --- a/Application.hs +++ b/Application.hs @@ -22,7 +22,8 @@ import Network.Wai (Middleware) import Network.Wai.Handler.Warp (Settings, defaultSettings, defaultShouldDisplayException, runSettings, setHost, - setOnException, setPort, getPort) + setOnException, setPort, getPort, + setBeforeMainLoop) import Network.Wai.Middleware.RequestLogger (Destination (Logger), IPAddrSource (..), OutputFormat (..), destination, @@ -45,6 +46,8 @@ import Handler.Types import Handler.List import Handler.InventoryList +import System.Systemd.Daemon + -- This line actually creates our YesodDispatch instance. It is the second half -- of the call to mkYesodData which occurs in Foundation.hs. Please see the -- comments there for more details. @@ -120,7 +123,8 @@ warpSettings foundation = "yesod" LevelError (toLogStr $ "Exception from Warp: " ++ show e)) - defaultSettings + $ setBeforeMainLoop (void notifyReady) + $ defaultSettings -- | For yesod devel, return the Warp settings and WAI Application. getApplicationDev :: IO (Settings, Application) -- cgit v1.2.3