summaryrefslogtreecommitdiff
path: root/buildstream/_pipeline.py
diff options
context:
space:
mode:
authorSam Thursfield <sam.thursfield@codethink.co.uk>2017-11-23 16:37:32 +0000
committerSam Thursfield <sam.thursfield@codethink.co.uk>2017-11-23 16:37:32 +0000
commitb075dd17cf0f4d7bdd0c22726a3a2df5a55d8498 (patch)
tree1cdc9139b6557af40f250dd15c50aebb4a617991 /buildstream/_pipeline.py
parent628e9a23f8b9d14f0216f85240b5ed148a08b117 (diff)
downloadbuildstream-sam/artifact-delay-init.tar.gz
Only initialize remote artifact cache connections if neededsam/artifact-delay-init
This fixes a regression from the canonical-pull-urls branch that was just merged. The OSTreeCache.__init__() function was connecting to the cache, which is bad because execution would randomly freeze for several seconds when the connection was slow. We now only initialize remote connections where needed; this was already introduced in 5c2ef6d076921bc0121e61efaa7a719c34ea1912 but had regressed. I renamed the keyword arg from `fetch_remote_refs` to `use_remote_cache` because it needs to be set for any interaction with the remote cache, doesn't matter if they are fetches or pushes.
Diffstat (limited to 'buildstream/_pipeline.py')
-rw-r--r--buildstream/_pipeline.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/buildstream/_pipeline.py b/buildstream/_pipeline.py
index 8245b31ca..20a0c4bc2 100644
--- a/buildstream/_pipeline.py
+++ b/buildstream/_pipeline.py
@@ -116,7 +116,7 @@ class Pipeline():
def __init__(self, context, project, targets, except_,
inconsistent=False,
rewritable=False,
- fetch_remote_refs=False,
+ use_remote_cache=False,
load_ticker=None,
resolve_ticker=None,
remote_ticker=None,
@@ -171,10 +171,11 @@ class Pipeline():
self.project._set_workspace(element, source, workspace)
- if fetch_remote_refs and self.artifacts.can_fetch():
+ if use_remote_cache and self.artifacts.can_fetch():
try:
if remote_ticker:
remote_ticker(self.artifacts.url)
+ self.artifacts.initialize_remote()
self.artifacts.fetch_remote_refs()
except ArtifactError:
self.message(MessageType.WARN, "Failed to fetch remote refs")