don't exclude special remotes from the knownRemotes list used by the assistant

But do exclude them when pushing out changes.
This commit is contained in:
Joey Hess 2012-08-26 14:56:26 -04:00
parent c58d553265
commit 4d269db520
2 changed files with 9 additions and 4 deletions

View file

@ -14,7 +14,7 @@ import Utility.ThreadScheduler
import Utility.TempFile
import Utility.NotificationBroadcaster
import Logs.Transfer
import qualified Command.Sync
import qualified Remote
import Control.Concurrent.STM
import System.Posix.Types
@ -81,11 +81,14 @@ modifyDaemonStatus dstatus a = do
sendNotification $ changeNotifier s
return b
calcKnownRemotes :: Annex [Remote]
calcKnownRemotes = concat . Remote.byCost <$> Remote.enabledRemoteList
{- Updates the cached ordered list of remotes from the list in Annex
- state. -}
updateKnownRemotes :: DaemonStatusHandle -> Annex ()
updateKnownRemotes dstatus = do
remotes <- Command.Sync.syncRemotes []
remotes <- calcKnownRemotes
liftIO $ modifyDaemonStatus_ dstatus $
\s -> s { knownRemotes = remotes }
@ -97,7 +100,7 @@ startDaemonStatus = do
status <- liftIO $
catchDefaultIO (readDaemonStatusFile file) =<< newDaemonStatus
transfers <- M.fromList <$> getTransfers
remotes <- Command.Sync.syncRemotes []
remotes <- calcKnownRemotes
liftIO $ atomically $ newTMVar status
{ scanComplete = False
, sanityCheckRunning = False

View file

@ -15,6 +15,7 @@ import Assistant.ThreadedMonad
import Assistant.DaemonStatus
import Assistant.Sync
import Utility.ThreadScheduler
import qualified Remote
import Data.Time.Clock
@ -50,7 +51,8 @@ pushThread st dstatus commitchan pushmap = do
now <- getCurrentTime
if shouldPush now commits
then do
remotes <- knownRemotes <$> getDaemonStatus dstatus
remotes <- filter (not . Remote.specialRemote) .
knownRemotes <$> getDaemonStatus dstatus
unless (null remotes) $
void $ alertWhile dstatus (pushAlert remotes) $
pushToRemotes thisThread now st (Just pushmap) remotes