This commit is contained in:
Joey Hess 2013-03-13 13:05:30 -04:00
parent f39dc54644
commit 60760cb430
2 changed files with 15 additions and 8 deletions

View file

@ -58,14 +58,14 @@ queueTransfersMatching matching reason schedule k f direction
| otherwise = go
where
go = do
rs <- liftAnnex . sufficientremotes
rs <- liftAnnex . selectremotes
=<< syncDataRemotes <$> getDaemonStatus
let matchingrs = filter (matching . Remote.uuid) rs
if null matchingrs
then defer
else forM_ matchingrs $ \r ->
enqueue reason schedule (gentransfer r) (stubInfo f r)
sufficientremotes rs
selectremotes rs
{- Queue downloads from all remotes that
- have the key, with the cheapest ones first.
- More expensive ones will only be tried if
@ -107,7 +107,8 @@ queueDeferredDownloads reason schedule = do
let sources = filter (\r -> uuid r `elem` uuids) rs
unless (null sources) $
forM_ sources $ \r ->
enqueue reason schedule (gentransfer r) (stubInfo f r)
enqueue reason schedule
(gentransfer r) (stubInfo f r)
return $ null sources
where
gentransfer r = Transfer