Jonathan Maw pushed to branch jonathan/cascache-cell-var-from-loop at BuildStream / buildstream
Commits:
-
5013b5f4
by Jonathan Maw at 2018-08-20T15:31:43Z
1 changed file:
Changes:
... | ... | @@ -316,7 +316,7 @@ class CASCache(ArtifactCache): |
316 | 316 |
resource_name = '/'.join(['uploads', str(uuid_), 'blobs',
|
317 | 317 |
digest.hash, str(digest.size_bytes)])
|
318 | 318 |
|
319 |
- def request_stream():
|
|
319 |
+ def request_stream(resname):
|
|
320 | 320 |
with open(self.objpath(digest), 'rb') as f:
|
321 | 321 |
assert os.fstat(f.fileno()).st_size == digest.size_bytes
|
322 | 322 |
offset = 0
|
... | ... | @@ -330,12 +330,12 @@ class CASCache(ArtifactCache): |
330 | 330 |
request.write_offset = offset
|
331 | 331 |
# max. 64 kB chunks
|
332 | 332 |
request.data = f.read(chunk_size)
|
333 |
- request.resource_name = resource_name
|
|
333 |
+ request.resource_name = resname
|
|
334 | 334 |
request.finish_write = remaining <= 0
|
335 | 335 |
yield request
|
336 | 336 |
offset += chunk_size
|
337 | 337 |
finished = request.finish_write
|
338 |
- response = remote.bytestream.Write(request_stream())
|
|
338 |
+ response = remote.bytestream.Write(request_stream(resource_name))
|
|
339 | 339 |
|
340 | 340 |
request = buildstream_pb2.UpdateReferenceRequest()
|
341 | 341 |
request.keys.append(ref)
|