Skip to content

Commit

Permalink
Update bluesky_kafka/__init__.py
Browse files Browse the repository at this point in the history
Prevent potential infinite recursion by checking page_len

Co-authored-by: Thomas A Caswell <[email protected]>
  • Loading branch information
cjtitus and tacaswell authored Mar 26, 2024
1 parent 1bdc4b4 commit bf89cfc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions bluesky_kafka/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@ def __call__(self, name, doc):
if KErr.code() == KafkaError.MSG_SIZE_TOO_LARGE:
if name == "event_page":
page_len = len(doc['seq_num'])
if page_len == 1:
raise
new_event_list = rechunk_event_pages([doc], (page_len + 1)//2)
for event in new_event_list:
self.__call__(name, event)
Expand Down

0 comments on commit bf89cfc

Please sign in to comment.