From 6144f325b985b16d6d52f7b8a1ec278efc03fb6d Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 14 Oct 2012 15:09:37 -0400 Subject: [PATCH] reorder get list of remotes after, rather than before, a potentially blocking action --- Assistant/TransferQueue.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Assistant/TransferQueue.hs b/Assistant/TransferQueue.hs index 766d2b44a3..125b6d164f 100644 --- a/Assistant/TransferQueue.hs +++ b/Assistant/TransferQueue.hs @@ -104,8 +104,8 @@ queueTransfersMatching matching schedule q dstatus k f direction - any others in the list to try again later. -} queueDeferredDownloads :: Schedule -> TransferQueue -> DaemonStatusHandle -> Annex () queueDeferredDownloads schedule q dstatus = do - rs <- syncRemotes <$> liftIO (getDaemonStatus dstatus) l <- liftIO $ atomically $ swapTVar (deferreddownloads q) [] + rs <- syncRemotes <$> liftIO (getDaemonStatus dstatus) left <- filterM (queue rs) l unless (null left) $ liftIO $ atomically $ modifyTVar' (deferreddownloads q) $