aboutsummaryrefslogtreecommitdiff
path: root/Assistant.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-01-26 17:09:33 +1100
committerGravatar Joey Hess <joey@kitenet.net>2013-01-26 17:09:33 +1100
commitdc60216eb8fe919acf7ab3984a5f0bf0e0193f6b (patch)
tree7fb8c8bd0189f1868e732fc1c6047df933333ecf /Assistant.hs
parentf0f97334d017eac6d1693bac90c772022fa57aa7 (diff)
webapp: Now allows restarting any threads that crash.
Diffstat (limited to 'Assistant.hs')
-rw-r--r--Assistant.hs9
1 files changed, 5 insertions, 4 deletions
diff --git a/Assistant.hs b/Assistant.hs
index d1a9f7102..45c0e9f03 100644
--- a/Assistant.hs
+++ b/Assistant.hs
@@ -154,6 +154,7 @@ import Assistant.Threads.XMPPClient
import Assistant.Environment
import qualified Utility.Daemon
import Utility.LogFile
+import Utility.ThreadScheduler
stopDaemon :: Annex ()
stopDaemon = liftIO . Utility.Daemon.stopDaemon =<< fromRepo gitAnnexPidFile
@@ -196,7 +197,7 @@ startDaemon assistant foreground startbrowser = do
d <- getAssistant id
urlrenderer <- liftIO newUrlRenderer
#endif
- mapM_ startthread
+ mapM_ (startthread urlrenderer)
[ watch $ commitThread
#ifdef WITH_WEBAPP
, assist $ webAppThread d urlrenderer False Nothing webappwaiter
@@ -224,10 +225,10 @@ startDaemon assistant foreground startbrowser = do
, watch $ watchThread
]
- waitNamedThreads
+ liftIO waitForTermination
watch a = (True, a)
assist a = (False, a)
- startthread (watcher, t)
- | watcher || assistant = startNamedThread t
+ startthread urlrenderer (watcher, t)
+ | watcher || assistant = startNamedThread (Just urlrenderer) t
| otherwise = noop