summaryrefslogtreecommitdiff
path: root/Annex/NumCopies.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Annex/NumCopies.hs')
-rw-r--r--Annex/NumCopies.hs15
1 files changed, 6 insertions, 9 deletions
diff --git a/Annex/NumCopies.hs b/Annex/NumCopies.hs
index 5e818fe95..9fea49db6 100644
--- a/Annex/NumCopies.hs
+++ b/Annex/NumCopies.hs
@@ -121,24 +121,21 @@ verifyEnoughCopiesToDrop
verifyEnoughCopiesToDrop nolocmsg key removallock need skip preverified tocheck dropaction nodropaction =
helper [] [] preverified (nub tocheck)
where
- helper bad missing have [] = do
- p <- liftIO $ mkSafeDropProof need have removallock
- case p of
+ helper bad missing have [] =
+ liftIO (mkSafeDropProof need have removallock) >>= \case
Right proof -> dropaction proof
Left stillhave -> do
notEnoughCopies key need stillhave (skip++missing) bad nolocmsg
nodropaction
helper bad missing have (c:cs)
- | isSafeDrop need have removallock = do
- p <- liftIO $ mkSafeDropProof need have removallock
- case p of
+ | isSafeDrop need have removallock =
+ liftIO (mkSafeDropProof need have removallock) >>= \case
Right proof -> dropaction proof
Left stillhave -> helper bad missing stillhave (c:cs)
| otherwise = case c of
UnVerifiedHere -> lockContentShared key contverified
- UnVerifiedRemote r -> checkremote r contverified $ do
- haskey <- Remote.hasKey r key
- case haskey of
+ UnVerifiedRemote r -> checkremote r contverified $
+ Remote.hasKey r key >>= \case
Right True -> helper bad missing (mkVerifiedCopy RecentlyVerifiedCopy r : have) cs
Left _ -> helper (r:bad) missing have cs
Right False -> helper bad (Remote.uuid r:missing) have cs