summaryrefslogtreecommitdiff
path: root/Assistant
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-08-02 13:57:34 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-08-02 13:57:34 -0400
commite21a32627fc600e6f7fa72929c95cfb49390dae3 (patch)
tree472e65a430784eb2275a9c01e082e4553dfc0785 /Assistant
parenta6e4283fed739207e3fd5a239ec71f7a71789259 (diff)
avoid bogus alert errors
Diffstat (limited to 'Assistant')
-rw-r--r--Assistant/Threads/Committer.hs11
1 files changed, 7 insertions, 4 deletions
diff --git a/Assistant/Threads/Committer.hs b/Assistant/Threads/Committer.hs
index 2ca6a15b9..cce8d5e2b 100644
--- a/Assistant/Threads/Committer.hs
+++ b/Assistant/Threads/Committer.hs
@@ -145,16 +145,19 @@ handleAdds st changechan transferqueue dstatus cs = returnWhen (null pendingadds
add :: Change -> IO (Maybe Change)
add change@(PendingAddChange { keySource = ks }) =
alertWhile' dstatus (addFileAlert $ keyFilename ks) $
- liftM maybeMaybe $ catchMaybeIO $
+ liftM ret $ catchMaybeIO $
sanitycheck ks $ runThreadState st $ do
showStart "add" $ keyFilename ks
key <- Command.Add.ingest ks
handle (finishedChange change) (keyFilename ks) key
+ where
+ {- Add errors tend to be transient and will
+ - be automatically dealt with, so don't
+ - pass to the alert code. -}
+ ret (Just j@(Just _)) = (True, j)
+ ret _ = (True, Nothing)
add _ = return Nothing
- maybeMaybe (Just j@(Just _)) = (True, j)
- maybeMaybe _ = (False, Nothing)
-
handle _ _ Nothing = do
showEndFail
return Nothing