aboutsummaryrefslogtreecommitdiff
path: root/Assistant/Threads
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-08-02 09:03:04 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-08-02 09:03:04 -0400
commit191ee3b697cfefd4061c2a398b4c6a021895bacd (patch)
tree2012fcc8c70f11dbacb0d1620adf7563c4195886 /Assistant/Threads
parent3695cab949ccd6096f3ce1c121a909416851462c (diff)
awesome alert combining
Now an alert tracks files that have recently been added. As a large file is added, it will have its own alert, that then combines with the tracker when dones. Also used for combining sanity checker alerts, as it could possibly want to display a lot.
Diffstat (limited to 'Assistant/Threads')
-rw-r--r--Assistant/Threads/Committer.hs16
1 files changed, 9 insertions, 7 deletions
diff --git a/Assistant/Threads/Committer.hs b/Assistant/Threads/Committer.hs
index f236159f9..2ca6a15b9 100644
--- a/Assistant/Threads/Committer.hs
+++ b/Assistant/Threads/Committer.hs
@@ -10,6 +10,7 @@ module Assistant.Threads.Committer where
import Assistant.Common
import Assistant.Changes
import Assistant.Commits
+import Assistant.Alert
import Assistant.ThreadedMonad
import Assistant.Threads.Watcher
import Assistant.TransferQueue
@@ -143,15 +144,16 @@ handleAdds st changechan transferqueue dstatus cs = returnWhen (null pendingadds
add :: Change -> IO (Maybe Change)
add change@(PendingAddChange { keySource = ks }) =
- liftM maybeMaybe $ catchMaybeIO $
- sanitycheck ks $ runThreadState st $ do
- showStart "add" $ keyFilename ks
- key <- Command.Add.ingest ks
- handle (finishedChange change) (keyFilename ks) key
+ alertWhile' dstatus (addFileAlert $ keyFilename ks) $
+ liftM maybeMaybe $ catchMaybeIO $
+ sanitycheck ks $ runThreadState st $ do
+ showStart "add" $ keyFilename ks
+ key <- Command.Add.ingest ks
+ handle (finishedChange change) (keyFilename ks) key
add _ = return Nothing
- maybeMaybe (Just j@(Just _)) = j
- maybeMaybe _ = Nothing
+ maybeMaybe (Just j@(Just _)) = (True, j)
+ maybeMaybe _ = (False, Nothing)
handle _ _ Nothing = do
showEndFail