summaryrefslogtreecommitdiff
path: root/Assistant/DaemonStatus.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-10-14 14:47:01 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-10-14 14:50:03 -0400
commit83c8c3104583d6fea4c44751b39191b1f4af443f (patch)
tree670ee370decd2e9e4fca38f4f66077e77c92dce5 /Assistant/DaemonStatus.hs
parentec23c75632cf1b8e4e3d5049a2c0a7623a9ae958 (diff)
better variable name
Diffstat (limited to 'Assistant/DaemonStatus.hs')
-rw-r--r--Assistant/DaemonStatus.hs23
1 files changed, 11 insertions, 12 deletions
diff --git a/Assistant/DaemonStatus.hs b/Assistant/DaemonStatus.hs
index 8146f977e..60b560b90 100644
--- a/Assistant/DaemonStatus.hs
+++ b/Assistant/DaemonStatus.hs
@@ -41,8 +41,8 @@ data DaemonStatus = DaemonStatus
-- Messages to display to the user.
, alertMap :: AlertMap
, lastAlertId :: AlertId
- -- Ordered list of remotes to talk to.
- , knownRemotes :: [Remote]
+ -- Ordered list of remotes to sync with.
+ , syncRemotes :: [Remote]
-- Pairing request that is in progress.
, pairingInProgress :: Maybe PairingInProgress
-- Broadcasts notifications about all changes to the DaemonStatus
@@ -89,21 +89,20 @@ modifyDaemonStatus dstatus a = do
return b
{- Syncable remotes ordered by cost. -}
-calcKnownRemotes :: Annex [Remote]
-calcKnownRemotes = do
+calcSyncRemotes :: Annex [Remote]
+calcSyncRemotes = do
rs <- filterM (repoSyncable . Remote.repo) =<<
concat . Remote.byCost <$> Remote.enabledRemoteList
alive <- snd <$> trustPartition DeadTrusted (map Remote.uuid rs)
let good r = Remote.uuid r `elem` alive
return $ filter good rs
-{- Updates the cached ordered list of remotes from the list in Annex
- - state. -}
-updateKnownRemotes :: DaemonStatusHandle -> Annex ()
-updateKnownRemotes dstatus = do
- remotes <- calcKnownRemotes
+{- Updates the sycRemotes list from the list of all remotes in Annex state. -}
+updateSyncRemotes :: DaemonStatusHandle -> Annex ()
+updateSyncRemotes dstatus = do
+ remotes <- calcSyncRemotes
liftIO $ modifyDaemonStatus_ dstatus $
- \s -> s { knownRemotes = remotes }
+ \s -> s { syncRemotes = remotes }
{- Load any previous daemon status file, and store it in a MVar for this
- process to use as its DaemonStatus. Also gets current transfer status. -}
@@ -113,12 +112,12 @@ startDaemonStatus = do
status <- liftIO $
flip catchDefaultIO (readDaemonStatusFile file) =<< newDaemonStatus
transfers <- M.fromList <$> getTransfers
- remotes <- calcKnownRemotes
+ remotes <- calcSyncRemotes
liftIO $ atomically $ newTMVar status
{ scanComplete = False
, sanityCheckRunning = False
, currentTransfers = transfers
- , knownRemotes = remotes
+ , syncRemotes = remotes
}
{- Don't just dump out the structure, because it will change over time,