aboutsummaryrefslogtreecommitdiff
path: root/Assistant/Threads/SanityChecker.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-10-30 15:39:15 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-10-30 15:39:15 -0400
commit07cd1b2b40735d460c8225762fcf3992b9886c60 (patch)
treec08c38417dfd9cba94ac56e212fa9d5864927ac0 /Assistant/Threads/SanityChecker.hs
parentbab7e83221468905b76e28bb123ebe26e146b97b (diff)
pushed Assistant monad down into DaemonStatus code
Currently have three old versions of functions that more reworking is needed to remove: getDaemonStatusOld, modifyDaemonStatusOld_, and modifyDaemonStatusOld
Diffstat (limited to 'Assistant/Threads/SanityChecker.hs')
-rw-r--r--Assistant/Threads/SanityChecker.hs9
1 files changed, 3 insertions, 6 deletions
diff --git a/Assistant/Threads/SanityChecker.hs b/Assistant/Threads/SanityChecker.hs
index 2ffdc9f32..1871b680e 100644
--- a/Assistant/Threads/SanityChecker.hs
+++ b/Assistant/Threads/SanityChecker.hs
@@ -28,14 +28,12 @@ sanityCheckerThread = NamedThread "SanityChecker" $ forever $ do
debug ["sanity check complete"]
where
go = do
- dstatus <- getAssistant daemonStatusHandle
- liftIO $ modifyDaemonStatus_ dstatus $ \s -> s
- { sanityCheckRunning = True }
+ modifyDaemonStatus_ $ \s -> s { sanityCheckRunning = True }
now <- liftIO $ getPOSIXTime -- before check started
r <- either showerr return =<< tryIO <~> check
- liftIO $ modifyDaemonStatus_ dstatus $ \s -> s
+ modifyDaemonStatus_ $ \s -> s
{ sanityCheckRunning = False
, lastSanityCheck = Just now
}
@@ -84,8 +82,7 @@ check = do
slop = fromIntegral tenMinutes
insanity msg = do
liftAnnex $ warning msg
- dstatus <- getAssistant daemonStatusHandle
- liftIO $ void $ addAlert dstatus $ sanityCheckFixAlert msg
+ void $ addAlert $ sanityCheckFixAlert msg
addsymlink file s = do
Watcher.runHandler Watcher.onAddSymlink file s
insanity $ "found unstaged symlink: " ++ file