summaryrefslogtreecommitdiff
path: root/Command
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2017-09-20 14:37:20 -0400
committerJoey Hess <joeyh@joeyh.name>2017-09-20 15:29:13 -0400
commitd71c65ca0a01202147d82315b200da6895491392 (patch)
tree7683598aaca771014f7a370758bdf433e9d47782 /Command
parent46d19648ee6e3a2e6fe357b6deb49d87455c8a46 (diff)
add exporter thread to assistant
This is similar to the pusher thread, but a separate thread because git pushes can be done in parallel with exports, and updating a big export should not prevent other git pushes going out in the meantime. The exportThread only runs at most every 30 seconds, since updating an export is more expensive than pushing. This may need to be tuned. Added a separate channel for export commits; the committer records a commit in that channel. Also, reconnectRemotes records a dummy commit, to make the exporter thread wake up and make sure all exports are up-to-date. So, connecting a drive with a directory special remote export will immediately update it, and getting online will automatically update S3 and WebDAV exports. The transfer queue is not involved in exports. Instead, failed exports are retried much like failed pushes. This commit was sponsored by Ewen McNeill.
Diffstat (limited to 'Command')
-rw-r--r--Command/Sync.hs6
1 files changed, 5 insertions, 1 deletions
diff --git a/Command/Sync.hs b/Command/Sync.hs
index 3a838c8a9a..44948ea749 100644
--- a/Command/Sync.hs
+++ b/Command/Sync.hs
@@ -21,6 +21,7 @@ module Command.Sync (
updateBranch,
syncBranch,
updateSyncBranch,
+ seekExportContent,
) where
import Command
@@ -652,7 +653,10 @@ syncFile ebloom rs af k = do
{- When a remote has an export-tracking branch, change the export to
- follow the current content of the branch. Otherwise, transfer any files
- - that were part of an export but are not in the remote yet. -}
+ - that were part of an export but are not in the remote yet.
+ -
+ - Returns True if any file transfers were made.
+ -}
seekExportContent :: [Remote] -> Annex Bool
seekExportContent rs = or <$> forM rs go
where