Skip to content
Snippets Groups Projects
Verified Commit 00583341 authored by Victor's avatar Victor
Browse files

[bug] add code to obey protocol pause and stop

Stream production wasn't pausing or stopping as asked by protocol.
parent ed498fad
No related branches found
No related tags found
1 merge request!172Upstreaming blobs
......@@ -67,6 +67,11 @@ class BlobsUpstreamProducer(object):
"""
consumer.write(json.dumps(self.blobs_lengths) + '\n')
for blob_id, _ in self.blobs_lengths:
if self.stop:
break
if self.pause:
yield self.sleep(0.001)
continue
blob_fd = yield self.db.get(blob_id, namespace=self.namespace)
doc_info = DocInfo(blob_id, FIXED_REV)
crypter = BlobEncryptor(doc_info, blob_fd, secret=self.secret,
......
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