aboutsummaryrefslogtreecommitdiff
path: root/Assistant/DaemonStatus.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2017-09-20 13:27:59 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2017-09-20 13:58:27 -0400
commitd20933a25956a3a07247f66fe3a554761d616173 (patch)
tree47bd006b6255beac3b7286977988c64dce6236a2 /Assistant/DaemonStatus.hs
parent7fa114e629fe33822763f376ac57b0efd48d5686 (diff)
first pass at assistant knowing about export remotes
Split exportRemotes out from syncDataRemotes; the parts of the assistant that upload keys and drop keys from remotes don't apply to exports, because those operations are not supported. Some parts of the assistant and webapp do operate on both syncDataRemotes and exportRemotes. Particularly when downloading from either of them. Added a downloadRemotes that combines both. With this, the assistant should download from exports, but it won't yet upload changes to them. This commit was sponsored by Fernando Jimenez on Patreon.
Diffstat (limited to 'Assistant/DaemonStatus.hs')
-rw-r--r--Assistant/DaemonStatus.hs10
1 files changed, 7 insertions, 3 deletions
diff --git a/Assistant/DaemonStatus.hs b/Assistant/DaemonStatus.hs
index 58cb28c01..49823c3c0 100644
--- a/Assistant/DaemonStatus.hs
+++ b/Assistant/DaemonStatus.hs
@@ -20,6 +20,7 @@ import Logs.TimeStamp
import qualified Remote
import qualified Types.Remote as Remote
import Config.DynamicConfig
+import Annex.Export
import Control.Concurrent.STM
import System.Posix.Types
@@ -53,15 +54,18 @@ calcSyncRemotes = do
alive <- trustExclude DeadTrusted (map Remote.uuid rs)
let good r = Remote.uuid r `elem` alive
let syncable = filter good rs
- syncdata <- filterM (not <$$> liftIO . getDynamicConfig . remoteAnnexIgnore . Remote.gitconfig) $
+ contentremotes <- filterM (not <$$> liftIO . getDynamicConfig . remoteAnnexIgnore . Remote.gitconfig) $
filter (\r -> Remote.uuid r /= NoUUID) $
filter (not . Remote.isXMPPRemote) syncable
+ let (exportremotes, dataremotes) = partition (exportTree . Remote.config) contentremotes
return $ \dstatus -> dstatus
{ syncRemotes = syncable
, syncGitRemotes = filter Remote.gitSyncableRemote syncable
- , syncDataRemotes = syncdata
- , syncingToCloudRemote = any iscloud syncdata
+ , syncDataRemotes = dataremotes
+ , exportRemotes = exportremotes
+ , downloadRemotes = contentremotes
+ , syncingToCloudRemote = any iscloud contentremotes
}
where
iscloud r = not (Remote.readonly r) && Remote.availability r == Remote.GloballyAvailable