diff options
author | Thomas Coldrick <thomas.coldrick@codethink.co.uk> | 2020-05-27 14:37:12 +0100 |
---|---|---|
committer | Thomas Coldrick <thomas.coldrick@codethink.co.uk> | 2020-05-27 14:37:12 +0100 |
commit | 1860e4efb00cc2f1105a7c4bf8c3c1b875f17e9f (patch) | |
tree | e84a8852ff24c08bf0f281c93eb79453eb1de613 | |
parent | 14dd3598024b58e9e626897e7062dd9563a1502a (diff) | |
download | buildstream-coldtom/contains_files-fix.tar.gz |
cascache: Use local CAS for contains_filescoldtom/contains_files-fix
Currently `CASCache.contains_files()` polls the remote CAS rather than
the local one. This leads to the function not doing what it says it
does, and also causes excessive polling of the remote CAS every time we
want to check whether an artifact is cached.
-rw-r--r-- | src/buildstream/_cas/cascache.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/buildstream/_cas/cascache.py b/src/buildstream/_cas/cascache.py index 74912c4e2..e3eed6d16 100644 --- a/src/buildstream/_cas/cascache.py +++ b/src/buildstream/_cas/cascache.py @@ -175,12 +175,12 @@ class CASCache: # Returns: True if the files are in the cache, False otherwise # def contains_files(self, digests): - cas = self.get_cas() + local_cas = self.get_local_cas() - request = remote_execution_pb2.FindMissingBlobsRequest() + request = remote_execution_pb2.FetchMissingBlobsRequest() request.blob_digests.extend(digests) - response = cas.FindMissingBlobs(request) + response = local_cas.FetchMissingBlobs(request) return len(response.missing_blob_digests) == 0 # contains_directory(): |