You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildstream.apache.org by ju...@apache.org on 2021/03/18 09:55:12 UTC

[buildstream] branch master updated: Only show the Initializing remote caches message once

This is an automated email from the ASF dual-hosted git repository.

juergbi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/buildstream.git


The following commit(s) were added to refs/heads/master by this push:
     new 5e0bcc1  Only show the Initializing remote caches message once
     new 7045bec  Merge pull request #1451 from abderrahim/init-remote-caches
5e0bcc1 is described below

commit 5e0bcc1b2bc89d6b7869be1182f62abea41f5269
Author: Abderrahim Kitouni <ak...@gnome.org>
AuthorDate: Sat Mar 6 13:09:38 2021 +0100

    Only show the Initializing remote caches message once
---
 src/buildstream/_assetcache.py | 25 ++++++++++++-------------
 src/buildstream/_context.py    |  7 ++++---
 2 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/src/buildstream/_assetcache.py b/src/buildstream/_assetcache.py
index 66e2182..e096c5f 100644
--- a/src/buildstream/_assetcache.py
+++ b/src/buildstream/_assetcache.py
@@ -327,19 +327,18 @@ class AssetCache:
         # Hold on to the project specs
         self._project_specs = project_specs
 
-        with self.context.messenger.timed_activity("Initializing remote caches", silent_nested=True):
-            for spec in specs:
-                # This can be called multiple times, ensure that we only try
-                # to instantiate each remote once.
-                #
-                if spec in self._remotes:
-                    continue
-
-                remote = RemotePair(self.cas, spec)
-                if remote.error:
-                    self.context.messenger.warn("Failed to initialize remote {}: {}".format(spec.url, remote.error))
-
-                self._remotes[spec] = remote
+        for spec in specs:
+            # This can be called multiple times, ensure that we only try
+            # to instantiate each remote once.
+            #
+            if spec in self._remotes:
+                continue
+
+            remote = RemotePair(self.cas, spec)
+            if remote.error:
+                self.context.messenger.warn("Failed to initialize remote {}: {}".format(spec.url, remote.error))
+
+            self._remotes[spec] = remote
 
         # Determine overall existance of push or fetch remotes
         self._has_fetch_remotes = any(remote.storage for _, remote in self._remotes.items()) and any(
diff --git a/src/buildstream/_context.py b/src/buildstream/_context.py
index 1dc89c5..7a46caa 100644
--- a/src/buildstream/_context.py
+++ b/src/buildstream/_context.py
@@ -593,9 +593,10 @@ class Context:
 
         # Now initialize the underlying asset caches
         #
-        self.artifactcache.setup_remotes(self._active_artifact_cache_specs, self.project_artifact_cache_specs)
-        self.elementsourcescache.setup_remotes(self._active_source_cache_specs, self.project_source_cache_specs)
-        self.sourcecache.setup_remotes(self._active_source_cache_specs, self.project_source_cache_specs)
+        with self.messenger.timed_activity("Initializing remote caches", silent_nested=True):
+            self.artifactcache.setup_remotes(self._active_artifact_cache_specs, self.project_artifact_cache_specs)
+            self.elementsourcescache.setup_remotes(self._active_source_cache_specs, self.project_source_cache_specs)
+            self.sourcecache.setup_remotes(self._active_source_cache_specs, self.project_source_cache_specs)
 
     # get_workspaces():
     #