diff options
author | Joey Hess <joey@kitenet.net> | 2013-04-23 18:23:04 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2013-04-23 18:23:04 -0400 |
commit | 697b510c9343a1fa5013bb307a5ce5e38c46e46e (patch) | |
tree | 1dae96839055b2173e1ae96dd8afa966c5087b4f /Assistant | |
parent | b46fbec1baa65f0328e82f4817a89dd5f8a46bed (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')
-rw-r--r-- | Assistant/Threads/Committer.hs | 7 |
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 |