Skip to content

Commit

Permalink
[client] Avoid recursion error
Browse files Browse the repository at this point in the history
  • Loading branch information
SamuelHassine committed Sep 15, 2024
1 parent 9d1ac08 commit 3a2d69a
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions pycti/connector/opencti_connector_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -1779,7 +1779,6 @@ def _send_bundle(self, channel, bundle, **kwargs) -> None:
sequence = kwargs.get("sequence", 0)
update = kwargs.get("update", False)
entities_types = kwargs.get("entities_types", None)
retry = kwargs.get("retry", 0)

if entities_types is None:
entities_types = []
Expand Down Expand Up @@ -1820,10 +1819,8 @@ def _send_bundle(self, channel, bundle, **kwargs) -> None:
except (UnroutableError, NackError):
self.connector_logger.error("Unable to send bundle, retry...")
self.metric.inc("error_count")
retry = retry + 1
if retry < 5:
kwargs.setdefault("retry", retry)
self._send_bundle(channel, bundle, **kwargs)
time.sleep(10)
self._send_bundle(channel, bundle, **kwargs)

def stix2_get_embedded_objects(self, item) -> Dict:
"""gets created and marking refs for a stix2 item
Expand Down

0 comments on commit 3a2d69a

Please sign in to comment.