Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Removed unneeded forkIO and waitForTermination.

These are only needed if you need to do cleanup (or save state)
on exit, which we don't with the current system.
This will make it easier to write an init script.
  • Loading branch information...
commit 3ef1d96938e9df699316183a1032fbf104dec383 1 parent 5704253
@jgm authored
Showing with 1 addition and 36 deletions.
  1. +0 −29 Network/Gitit/Server.hs
  2. +1 −7 gitit.hs
View
29 Network/Gitit/Server.hs
@@ -33,7 +33,6 @@ module Network.Gitit.Server
, setContentType
, setFilename
, lookupIPAddr
- , waitForTermination
, module Happstack.Server
, compressedResponseFilter
)
@@ -84,31 +83,3 @@ lookupIPAddr hostname = do
then return Nothing
else return $ Just $ takeWhile (/=':') $ show $ addrAddress $ head addrs
-
--- mime types
-
--- Note: waitForTermination is copied from Happstack.State.Control
--- to avoid a dependency on happstack-state. (Shouldn't this
--- function be in happstack-server?)
-
--- | Wait for a signal.
--- On unix, a signal is sigINT or sigTERM. On windows, the signal
--- is entering 'e'.
-waitForTermination :: IO ()
-waitForTermination
- = do
-#ifdef UNIX
- istty <- queryTerminal stdInput
- mv <- newEmptyMVar
- installHandler softwareTermination (CatchOnce (putMVar mv ())) Nothing
- case istty of
- True -> do installHandler keyboardSignal (CatchOnce (putMVar mv ())) Nothing
- return ()
- False -> return ()
- takeMVar mv
-#else
- let loop 'e' = return ()
- loop _ = getChar >>= loop
- loop 'c'
-#endif
-
View
8 gitit.hs
@@ -25,7 +25,6 @@ import Network.Gitit.Initialize (createStaticIfMissing, createRepoIfMissing)
import Prelude hiding (writeFile, readFile, catch)
import System.Directory
import System.FilePath ((</>))
-import Control.Concurrent
import Network.Gitit.Config (getConfigFromOpts)
import Data.Maybe (isNothing)
import Control.Monad.Reader
@@ -76,10 +75,5 @@ main = do
let serverConf = Conf { validator = Nothing, port = portNumber conf' }
-- start the server
- tid <- forkIO $ simpleHTTP serverConf $ wikiHandler conf'
- waitForTermination
-
- -- shut down the server
- killThread tid
-
+ simpleHTTP serverConf $ wikiHandler conf'
Please sign in to comment.
Something went wrong with that request. Please try again.