Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

31 lines (27 sloc) 0.911 kb
{-# LANGUAGE PackageImports #-}
import "neoprene" Application (getApplicationDev)
import Network.Wai.Handler.Warp
(runSettings, defaultSettings, settingsPort)
import Control.Concurrent (forkIO)
import System.Directory (doesFileExist, removeFile)
import System.Exit (exitSuccess)
--import Control.Concurrent (threadDelay)
import System.Process (system)
main :: IO ()
main = do
putStrLn "Starting devel application"
(port, app) <- getApplicationDev
forkIO $ runSettings defaultSettings
{ settingsPort = port
} app
loop
loop :: IO ()
loop = do
-- `threadDelay` doesn't work properly and causes `yesod devel` to use 100% CPU
-- this is a known issue: https://github.com/yesodweb/yesod/issues/433
--threadDelay 100000
system "sleep 1"
e <- doesFileExist "dist/devel-terminate"
if e then terminateDevel else loop
terminateDevel :: IO ()
terminateDevel = exitSuccess
Jump to Line
Something went wrong with that request. Please try again.