diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2017-04-13 19:54:00 +0200 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2017-04-13 19:54:00 +0200 |
commit | faf009aca16ba1e384fd5da2d6306d1379e36de3 (patch) | |
tree | 69a9183f09b75188b811ddb4eca13727b77f1630 /Application.hs | |
parent | e3227f80fe775acd1bd5bf7ad672bdf687787a6f (diff) | |
download | bar-faf009aca16ba1e384fd5da2d6306d1379e36de3.tar bar-faf009aca16ba1e384fd5da2d6306d1379e36de3.tar.gz bar-faf009aca16ba1e384fd5da2d6306d1379e36de3.tar.bz2 bar-faf009aca16ba1e384fd5da2d6306d1379e36de3.tar.xz bar-faf009aca16ba1e384fd5da2d6306d1379e36de3.zip |
Support systemd.service notify type
Diffstat (limited to 'Application.hs')
-rw-r--r-- | Application.hs | 8 |
1 files changed, 6 insertions, 2 deletions
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) | |||
22 | import Network.Wai.Handler.Warp (Settings, defaultSettings, | 22 | import Network.Wai.Handler.Warp (Settings, defaultSettings, |
23 | defaultShouldDisplayException, | 23 | defaultShouldDisplayException, |
24 | runSettings, setHost, | 24 | runSettings, setHost, |
25 | setOnException, setPort, getPort) | 25 | setOnException, setPort, getPort, |
26 | setBeforeMainLoop) | ||
26 | import Network.Wai.Middleware.RequestLogger (Destination (Logger), | 27 | import Network.Wai.Middleware.RequestLogger (Destination (Logger), |
27 | IPAddrSource (..), | 28 | IPAddrSource (..), |
28 | OutputFormat (..), destination, | 29 | OutputFormat (..), destination, |
@@ -45,6 +46,8 @@ import Handler.Types | |||
45 | import Handler.List | 46 | import Handler.List |
46 | import Handler.InventoryList | 47 | import Handler.InventoryList |
47 | 48 | ||
49 | import System.Systemd.Daemon | ||
50 | |||
48 | -- This line actually creates our YesodDispatch instance. It is the second half | 51 | -- This line actually creates our YesodDispatch instance. It is the second half |
49 | -- of the call to mkYesodData which occurs in Foundation.hs. Please see the | 52 | -- of the call to mkYesodData which occurs in Foundation.hs. Please see the |
50 | -- comments there for more details. | 53 | -- comments there for more details. |
@@ -120,7 +123,8 @@ warpSettings foundation = | |||
120 | "yesod" | 123 | "yesod" |
121 | LevelError | 124 | LevelError |
122 | (toLogStr $ "Exception from Warp: " ++ show e)) | 125 | (toLogStr $ "Exception from Warp: " ++ show e)) |
123 | defaultSettings | 126 | $ setBeforeMainLoop (void notifyReady) |
127 | $ defaultSettings | ||
124 | 128 | ||
125 | -- | For yesod devel, return the Warp settings and WAI Application. | 129 | -- | For yesod devel, return the Warp settings and WAI Application. |
126 | getApplicationDev :: IO (Settings, Application) | 130 | getApplicationDev :: IO (Settings, Application) |