summaryrefslogtreecommitdiff
path: root/Assistant/Threads/Watcher.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-07-29 19:05:51 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-07-29 19:05:51 -0400
commitd62b157194248402b566e96bbc92d19b8e1ce6e8 (patch)
treeb7cb5cc9966dd8ceb5f81715a382c22abc6bf1c2 /Assistant/Threads/Watcher.hs
parentd52c93242450c0bd01e7d3c1fdae375806aa6e1f (diff)
better ordering of alerts
Diffstat (limited to 'Assistant/Threads/Watcher.hs')
-rw-r--r--Assistant/Threads/Watcher.hs19
1 files changed, 12 insertions, 7 deletions
diff --git a/Assistant/Threads/Watcher.hs b/Assistant/Threads/Watcher.hs
index 1c8d122d5..ddbd51655 100644
--- a/Assistant/Threads/Watcher.hs
+++ b/Assistant/Threads/Watcher.hs
@@ -75,13 +75,18 @@ watchThread st dstatus transferqueue changechan = do
startupScan :: ThreadState -> DaemonStatusHandle -> IO a -> IO a
startupScan st dstatus scanner = do
runThreadState st $ showAction "scanning"
- r <- alertWhile dstatus startupScanAlert scanner
- modifyDaemonStatus_ dstatus $ \s -> s { scanComplete = True }
-
- -- Notice any files that were deleted before watching was started.
- runThreadState st $ do
- inRepo $ Git.Command.run "add" [Param "--update"]
- showAction "started"
+ r <- alertWhile dstatus startupScanAlert $ do
+ r <- scanner
+ modifyDaemonStatus_ dstatus $ \s -> s { scanComplete = True }
+
+ -- Notice any files that were deleted before
+ -- watching was started.
+ runThreadState st $ do
+ inRepo $ Git.Command.run "add" [Param "--update"]
+ showAction "started"
+ return r
+
+ void $ addAlert dstatus runningAlert
return r