Skip to content

Commit

Permalink
Fix recursive fulfillment
Browse files Browse the repository at this point in the history
  • Loading branch information
avanbrunt-cb committed Jun 30, 2021
1 parent 9626a5a commit e4c5d3c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion cabby/client11.py
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,10 @@ def poll(self, collection_name, begin_date=None, end_date=None,
part_number=part, uri=uri)

for block in fulfilment_stream:
if block is None:
# Break fulilment loop when PollResponse.more is false
has_data = False
break
has_data = True
yield block

Expand Down Expand Up @@ -545,5 +549,9 @@ def fulfilment(self, collection_name, result_id, part_number=1, uri=None):
service_type=const.SVC_POLL)

for obj in stream:
if isinstance(obj, tm11.ContentBlock):
if isinstance(obj, tm11.PollResponse):
# Verify if more ContentBlocks are available
if not obj.more:
yield
elif isinstance(obj, tm11.ContentBlock):
yield to_content_block_entity(obj)

0 comments on commit e4c5d3c

Please sign in to comment.