diff options
-rw-r--r-- | src/buildstream/_assetcache.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/buildstream/_assetcache.py b/src/buildstream/_assetcache.py index a0b502f2b..3993ca834 100644 --- a/src/buildstream/_assetcache.py +++ b/src/buildstream/_assetcache.py @@ -366,11 +366,18 @@ class AssetCache: # Args: # use_config (bool): Whether to use project configuration # remote_url (str): Remote cache URL + # reinitialize (bool): Whether to re-initialize the remotes a second time # # This requires that all of the projects which are to be processed in the session # have already been loaded and are observable in the Context. # - def setup_remotes(self, *, use_config=False, remote_url=None): + def setup_remotes(self, *, use_config=False, remote_url=None, reinitialize=False): + + # In some edge cases we need to reinitialize + if reinitialize: + self._storage_remotes = {} + self._index_remotes = {} + self._remotes_setup = False # Ensure we do not double-initialise since this can be expensive if self._remotes_setup: |