diff options
author | Jürg Billeter <j@bitron.ch> | 2018-01-23 11:04:45 +0000 |
---|---|---|
committer | Jürg Billeter <j@bitron.ch> | 2018-01-23 12:03:37 +0000 |
commit | bd33627405ffb75a3a4532d75ef4eb678798ce7f (patch) | |
tree | c61b386e5c7ee29b21f9babd95dac8cbac15dfad | |
parent | a9f72b71a946b9b92cf8e4538e5d7e21a12dae47 (diff) | |
download | buildstream-bd33627405ffb75a3a4532d75ef4eb678798ce7f.tar.gz |
fetchqueue.py: Wait for cache to become queryable
Wait for cache to become queryable instead of simply fetching the
sources.
-rw-r--r-- | buildstream/_scheduler/fetchqueue.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/buildstream/_scheduler/fetchqueue.py b/buildstream/_scheduler/fetchqueue.py index ebc1fa17a..6f4af018c 100644 --- a/buildstream/_scheduler/fetchqueue.py +++ b/buildstream/_scheduler/fetchqueue.py @@ -44,9 +44,17 @@ class FetchQueue(Queue): source._fetch() def status(self, element): + # state of dependencies may have changed, recalculate element state + element._update_state() + # Optionally skip elements that are already in the artifact cache - if self.skip_cached and element._cached(): - return QueueStatus.SKIP + if self.skip_cached: + # cache cannot be queried until strict cache key is available + if element._get_strict_cache_key() is None: + return QueueStatus.WAIT + + if element._cached(): + return QueueStatus.SKIP # This will automatically skip elements which # have no sources. |