avoid bogus alert errors
This commit is contained in:
parent
a6e4283fed
commit
e21a32627f
1 changed files with 7 additions and 4 deletions
|
@ -145,16 +145,19 @@ handleAdds st changechan transferqueue dstatus cs = returnWhen (null pendingadds
|
||||||
add :: Change -> IO (Maybe Change)
|
add :: Change -> IO (Maybe Change)
|
||||||
add change@(PendingAddChange { keySource = ks }) =
|
add change@(PendingAddChange { keySource = ks }) =
|
||||||
alertWhile' dstatus (addFileAlert $ keyFilename ks) $
|
alertWhile' dstatus (addFileAlert $ keyFilename ks) $
|
||||||
liftM maybeMaybe $ catchMaybeIO $
|
liftM ret $ catchMaybeIO $
|
||||||
sanitycheck ks $ runThreadState st $ do
|
sanitycheck ks $ runThreadState st $ do
|
||||||
showStart "add" $ keyFilename ks
|
showStart "add" $ keyFilename ks
|
||||||
key <- Command.Add.ingest ks
|
key <- Command.Add.ingest ks
|
||||||
handle (finishedChange change) (keyFilename ks) key
|
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
|
add _ = return Nothing
|
||||||
|
|
||||||
maybeMaybe (Just j@(Just _)) = (True, j)
|
|
||||||
maybeMaybe _ = (False, Nothing)
|
|
||||||
|
|
||||||
handle _ _ Nothing = do
|
handle _ _ Nothing = do
|
||||||
showEndFail
|
showEndFail
|
||||||
return Nothing
|
return Nothing
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue