aboutsummaryrefslogtreecommitdiff
path: root/Assistant/Threads/Committer.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-04-23 18:23:04 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-04-23 18:23:04 -0400
commit697b510c9343a1fa5013bb307a5ce5e38c46e46e (patch)
tree1dae96839055b2173e1ae96dd8afa966c5087b4f /Assistant/Threads/Committer.hs
parentb46fbec1baa65f0328e82f4817a89dd5f8a46bed (diff)
assistant: when an add fails, requeue it for later
See analysis in bug report for one way this could happen.
Diffstat (limited to 'Assistant/Threads/Committer.hs')
-rw-r--r--Assistant/Threads/Committer.hs7
1 files changed, 4 insertions, 3 deletions
diff --git a/Assistant/Threads/Committer.hs b/Assistant/Threads/Committer.hs
index aaec25206..04f94143b 100644
--- a/Assistant/Threads/Committer.hs
+++ b/Assistant/Threads/Committer.hs
@@ -256,14 +256,14 @@ handleAdds delayadd cs = returnWhen (null incomplete) $ do
| otherwise = a
add :: Change -> Assistant (Maybe Change)
- add change@(InProcessAddChange { keySource = ks }) = do
+ add change@(InProcessAddChange { keySource = ks }) =
alertWhile' (addFileAlert $ keyFilename ks) $
liftM ret $ catchMaybeIO <~> do
sanitycheck ks $ do
key <- liftAnnex $ do
showStart "add" $ keyFilename ks
Command.Add.ingest $ Just ks
- maybe failedingest (done change $ keyFilename ks) key
+ maybe (failedingest change) (done 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. -}
@@ -306,7 +306,8 @@ handleAdds delayadd cs = returnWhen (null incomplete) $ do
mkpairs k = map (\c -> (inodeCacheToKey ct c, k)) <$>
recordedInodeCache k
- failedingest = do
+ failedingest change = do
+ refill [change]
liftAnnex showEndFail
return Nothing