summaryrefslogtreecommitdiff
path: root/Assistant/Common.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Assistant/Common.hs')
-rw-r--r--Assistant/Common.hs9
1 files changed, 5 insertions, 4 deletions
diff --git a/Assistant/Common.hs b/Assistant/Common.hs
index d6df77f69..a6c6b8935 100644
--- a/Assistant/Common.hs
+++ b/Assistant/Common.hs
@@ -14,8 +14,9 @@ module Assistant.Common (
) where
import Common.Annex as X
-import Assistant.DaemonStatus
+import Assistant.Monad as X
import Assistant.Alert
+import Assistant.DaemonStatus
import System.Log.Logger
import qualified Control.Exception as E
@@ -26,10 +27,10 @@ data NamedThread = NamedThread ThreadName (IO ())
debug :: ThreadName -> [String] -> IO ()
debug threadname ws = debugM threadname $ unwords $ (threadname ++ ":") : ws
-runNamedThread :: DaemonStatusHandle -> NamedThread -> IO ()
-runNamedThread dstatus (NamedThread name a) = go
+runNamedThread :: NamedThread -> Assistant ()
+runNamedThread (NamedThread name a) = liftIO . go =<< getAssistant daemonStatus
where
- go = do
+ go dstatus = do
r <- E.try a :: IO (Either E.SomeException ())
case r of
Right _ -> noop