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
Branches
Tags
1 merge request!172Upstreaming blobs
...@@ -67,6 +67,11 @@ class BlobsUpstreamProducer(object): ...@@ -67,6 +67,11 @@ class BlobsUpstreamProducer(object):
""" """
consumer.write(json.dumps(self.blobs_lengths) + '\n') consumer.write(json.dumps(self.blobs_lengths) + '\n')
for blob_id, _ in self.blobs_lengths: 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) blob_fd = yield self.db.get(blob_id, namespace=self.namespace)
doc_info = DocInfo(blob_id, FIXED_REV) doc_info = DocInfo(blob_id, FIXED_REV)
crypter = BlobEncryptor(doc_info, blob_fd, secret=self.secret, 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.
Please register or to comment