From 6068fd160ffeb930368a4c4c2a8818ace71f29ab Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 11 Nov 2012 16:23:16 -0400 Subject: don't try to transfer data to/from XMPP remotes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Partition syncRemotes into ones needing git sync (ie, non-special remotes), and ones needing data sync (ie, non-XMPP remotes). --- Assistant/Threads/Pusher.hs | 9 ++------- Assistant/Threads/TransferScanner.hs | 4 ++-- Assistant/Threads/XMPPClient.hs | 2 +- 3 files changed, 5 insertions(+), 10 deletions(-) (limited to 'Assistant/Threads') diff --git a/Assistant/Threads/Pusher.hs b/Assistant/Threads/Pusher.hs index 69974a21c..035a454a1 100644 --- a/Assistant/Threads/Pusher.hs +++ b/Assistant/Threads/Pusher.hs @@ -15,7 +15,6 @@ import Assistant.Alert import Assistant.DaemonStatus import Assistant.Sync import Utility.ThreadScheduler -import qualified Remote import qualified Types.Remote as Remote import Data.Time.Clock @@ -46,7 +45,8 @@ pushThread = NamedThread "Pusher" $ runEvery (Seconds 2) <~> do -- Now see if now's a good time to push. if shouldPush commits then do - remotes <- filter pushable . syncRemotes <$> getDaemonStatus + remotes <- filter (not . Remote.readonly) + . syncGitRemotes <$> getDaemonStatus unless (null remotes) $ void $ alertWhile (pushAlert remotes) $ do now <- liftIO $ getCurrentTime @@ -54,11 +54,6 @@ pushThread = NamedThread "Pusher" $ runEvery (Seconds 2) <~> do else do debug ["delaying push of", show (length commits), "commits"] refillCommits commits - where - pushable r - | Remote.specialRemote r = False - | Remote.readonly r = False - | otherwise = True {- Decide if now is a good time to push to remotes. - diff --git a/Assistant/Threads/TransferScanner.hs b/Assistant/Threads/TransferScanner.hs index 3b3c3f304..918a266c7 100644 --- a/Assistant/Threads/TransferScanner.hs +++ b/Assistant/Threads/TransferScanner.hs @@ -57,7 +57,7 @@ transferScannerThread = NamedThread "TransferScanner" $ do - and then the system (or us) crashed, and that info was - lost. -} - startupScan = addScanRemotes True =<< syncRemotes <$> getDaemonStatus + startupScan = addScanRemotes True =<< syncDataRemotes <$> getDaemonStatus {- This is a cheap scan for failed transfers involving a remote. -} failedTransferScan :: Remote -> Assistant () @@ -114,7 +114,7 @@ expensiveScan rs = unless onlyweb $ do findtransfers f (key, _) = do {- The syncable remotes may have changed since this - scan began. -} - syncrs <- syncRemotes <$> getDaemonStatus + syncrs <- syncDataRemotes <$> getDaemonStatus liftAnnex $ do locs <- loggedLocations key present <- inAnnex key diff --git a/Assistant/Threads/XMPPClient.hs b/Assistant/Threads/XMPPClient.hs index 8df9ff04e..641e6da66 100644 --- a/Assistant/Threads/XMPPClient.hs +++ b/Assistant/Threads/XMPPClient.hs @@ -190,7 +190,7 @@ xmppThread a = do pull :: [UUID] -> Assistant () pull [] = noop pull us = do - rs <- filter matching . syncRemotes <$> getDaemonStatus + rs <- filter matching . syncGitRemotes <$> getDaemonStatus debug $ "push notification for" : map (fromUUID . Remote.uuid ) rs pullone rs =<< liftAnnex (inRepo Git.Branch.current) where -- cgit v1.2.3