summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJürg Billeter <j@bitron.ch>2018-01-23 11:04:45 +0000
committerJürg Billeter <j@bitron.ch>2018-01-23 12:03:37 +0000
commitbd33627405ffb75a3a4532d75ef4eb678798ce7f (patch)
treec61b386e5c7ee29b21f9babd95dac8cbac15dfad
parenta9f72b71a946b9b92cf8e4538e5d7e21a12dae47 (diff)
downloadbuildstream-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.py12
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.