aboutsummaryrefslogtreecommitdiff
path: root/Assistant/Threads/TransferScanner.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2017-03-10 13:12:24 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2017-03-10 13:35:31 -0400
commit8cb9381befed4174624edfc80e09185c9340b4f6 (patch)
treee5d2041ff38502b1f8a5ef9caa6515cccfcea555 /Assistant/Threads/TransferScanner.hs
parente230fd58b5f5d5d16f87e1bd5c0f2e553f2ae5a2 (diff)
AssociatedFile newtype
To prevent any further mistakes like 1a497cefb47557f0b4788c606f9071be422b2511 This commit was sponsored by Francois Marier on Patreon.
Diffstat (limited to 'Assistant/Threads/TransferScanner.hs')
-rw-r--r--Assistant/Threads/TransferScanner.hs9
1 files changed, 5 insertions, 4 deletions
diff --git a/Assistant/Threads/TransferScanner.hs b/Assistant/Threads/TransferScanner.hs
index 5436c2ca1..4b6a90cd9 100644
--- a/Assistant/Threads/TransferScanner.hs
+++ b/Assistant/Threads/TransferScanner.hs
@@ -154,8 +154,9 @@ expensiveScan urlrenderer rs = batch <~> do
enqueue f (r, t) =
queueTransferWhenSmall "expensive scan found missing object"
- (Just f) t r
+ (AssociatedFile (Just f)) t r
findtransfers f unwanted key = do
+ let af = AssociatedFile (Just f)
{- The syncable remotes may have changed since this
- scan began. -}
syncrs <- syncDataRemotes <$> getDaemonStatus
@@ -163,14 +164,14 @@ expensiveScan urlrenderer rs = batch <~> do
present <- liftAnnex $ inAnnex key
liftAnnex $ handleDropsFrom locs syncrs
"expensive scan found too many copies of object"
- present key (Just f) [] callCommandAction
+ present key af [] callCommandAction
liftAnnex $ do
let slocs = S.fromList locs
let use a = return $ mapMaybe (a key slocs) syncrs
ts <- if present
- then filterM (wantSend True (Just key) (Just f) . Remote.uuid . fst)
+ then filterM (wantSend True (Just key) af . Remote.uuid . fst)
=<< use (genTransfer Upload False)
- else ifM (wantGet True (Just key) (Just f))
+ else ifM (wantGet True (Just key) af)
( use (genTransfer Download True) , return [] )
let unwanted' = S.difference unwanted slocs
return (unwanted', ts)