summaryrefslogtreecommitdiff
path: root/Assistant/Threads/Watcher.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-07-30 02:07:02 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-07-30 02:39:24 -0400
commit3dce75fb23fca94ad86c3f0ee816bb0ad2ecb27c (patch)
tree942c851da412a65a1a569bc94e4fd287cd35f3da /Assistant/Threads/Watcher.hs
parentec0493fa4d45a8d8f6617c906727d653afb1c50e (diff)
make old activiy alerts stay visible
They're updated to show whether the activity succeeded or failed. This adds several TODOs to the code to fix later.
Diffstat (limited to 'Assistant/Threads/Watcher.hs')
-rw-r--r--Assistant/Threads/Watcher.hs13
1 files changed, 6 insertions, 7 deletions
diff --git a/Assistant/Threads/Watcher.hs b/Assistant/Threads/Watcher.hs
index ddbd51655..bfeec7630 100644
--- a/Assistant/Threads/Watcher.hs
+++ b/Assistant/Threads/Watcher.hs
@@ -72,24 +72,23 @@ watchThread st dstatus transferqueue changechan = do
}
{- Initial scartup scan. The action should return once the scan is complete. -}
-startupScan :: ThreadState -> DaemonStatusHandle -> IO a -> IO a
+startupScan :: ThreadState -> DaemonStatusHandle -> IO a -> IO ()
startupScan st dstatus scanner = do
runThreadState st $ showAction "scanning"
- r <- alertWhile dstatus startupScanAlert $ do
- r <- scanner
- modifyDaemonStatus_ dstatus $ \s -> s { scanComplete = True }
+ void $ alertWhile dstatus startupScanAlert $ do
+ void $ scanner
-- Notice any files that were deleted before
-- watching was started.
runThreadState st $ do
inRepo $ Git.Command.run "add" [Param "--update"]
showAction "started"
- return r
+
+ modifyDaemonStatus_ dstatus $ \s -> s { scanComplete = True }
+ return True
void $ addAlert dstatus runningAlert
- return r
-
ignored :: FilePath -> Bool
ignored = ig . takeFileName
where