Skip to content
Snippets Groups Projects
Commit 7eaf8853 authored by Martin Blanchard's avatar Martin Blanchard
Browse files

client/cas.py: Add a separate close method

#77
parent 1c5f47c7
No related branches found
No related tags found
No related merge requests found
......@@ -28,7 +28,7 @@ def upload(channel, instance=None, u_uid=None):
try:
yield uploader
finally:
uploader.flush()
uploader.close()
class Uploader:
......@@ -144,6 +144,18 @@ class Uploader:
if self.__requests:
self._send_batch()
def close(self):
"""Closes the underlying connection stubs.
Note:
This will always send pending requests before closing connections,
if any.
"""
self.flush()
self.__bytestream_stub = None
self.__cas_stub = None
def _queue_blob(self, blob):
"""Queues a memory block for later batch upload"""
blob_digest = remote_execution_pb2.Digest()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment