diff options
author | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2017-11-23 16:37:32 +0000 |
---|---|---|
committer | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2017-11-23 16:37:32 +0000 |
commit | b075dd17cf0f4d7bdd0c22726a3a2df5a55d8498 (patch) | |
tree | 1cdc9139b6557af40f250dd15c50aebb4a617991 /buildstream/_frontend/main.py | |
parent | 628e9a23f8b9d14f0216f85240b5ed148a08b117 (diff) | |
download | buildstream-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/_frontend/main.py')
-rw-r--r-- | buildstream/_frontend/main.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/buildstream/_frontend/main.py b/buildstream/_frontend/main.py index e02582799..d70645887 100644 --- a/buildstream/_frontend/main.py +++ b/buildstream/_frontend/main.py @@ -201,7 +201,7 @@ def cli(context, **kwargs): def build(app, elements, all, track): """Build elements in a pipeline""" - app.initialize(elements, rewritable=track, inconsistent=track, fetch_remote_refs=True) + app.initialize(elements, rewritable=track, inconsistent=track, use_remote_cache=True) app.print_heading() try: app.pipeline.build(app.scheduler, all, track) @@ -316,7 +316,7 @@ def pull(app, elements, deps): none: No dependencies, just the element itself all: All dependencies """ - app.initialize(elements, fetch_remote_refs=True) + app.initialize(elements, use_remote_cache=True) try: to_pull = app.pipeline.deps_elements(deps) app.pipeline.pull(app.scheduler, to_pull) @@ -346,7 +346,7 @@ def push(app, elements, deps): none: No dependencies, just the element itself all: All dependencies """ - app.initialize(elements, fetch_remote_refs=True) + app.initialize(elements, use_remote_cache=True) try: to_push = app.pipeline.deps_elements(deps) app.pipeline.push(app.scheduler, to_push) @@ -425,7 +425,7 @@ def show(app, elements, deps, except_, order, format, downloadable): bst show target.bst --format \\ $'---------- %{name} ----------\\n%{vars}' """ - app.initialize(elements, except_=except_, fetch_remote_refs=downloadable) + app.initialize(elements, except_=except_, use_remote_cache=downloadable) try: dependencies = app.pipeline.deps_elements(deps) except PipelineError as e: @@ -766,7 +766,7 @@ class App(): # Initialize the main pipeline # def initialize(self, elements, except_=tuple(), rewritable=False, - inconsistent=False, fetch_remote_refs=False): + inconsistent=False, use_remote_cache=False): profile_start(Topics.LOAD_PIPELINE, "_".join(t.replace(os.sep, '-') for t in elements)) @@ -842,7 +842,7 @@ class App(): self.pipeline = Pipeline(self.context, self.project, elements, except_, inconsistent=inconsistent, rewritable=rewritable, - fetch_remote_refs=fetch_remote_refs, + use_remote_cache=use_remote_cache, load_ticker=self.load_ticker, resolve_ticker=self.resolve_ticker, remote_ticker=self.remote_ticker, |