Fix zombie process that occurred when switching between repository views in the webapp.

This commit is contained in:
Joey Hess 2013-11-02 22:25:08 -04:00
parent a83dca0a58
commit 1f39aef893
3 changed files with 10 additions and 2 deletions

View file

@ -61,8 +61,12 @@ getSwitchToRepositoryR repo = do
threadDelay 100000 -- 1/10th of a second
a
{- Returns once the assistant has daemonized, but possibly before it's
- listening for web connections. -}
startAssistant :: FilePath -> IO ()
startAssistant repo = do
program <- readProgramFile
void $ forkIO $ void $ createProcess $
(proc program ["assistant"]) { cwd = Just repo }
(_, _, _, pid) <-
createProcess $
(proc program ["assistant"]) { cwd = Just repo }
void $ checkSuccessProcess pid