Skip to content
This repository was archived by the owner on Dec 5, 2025. It is now read-only.

Commit 9d1ac08

Browse files
committed
[client] Limit number of retry
1 parent 037935b commit 9d1ac08

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pycti/connector/opencti_connector_helper.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1779,6 +1779,7 @@ def _send_bundle(self, channel, bundle, **kwargs) -> None:
17791779
sequence = kwargs.get("sequence", 0)
17801780
update = kwargs.get("update", False)
17811781
entities_types = kwargs.get("entities_types", None)
1782+
retry = kwargs.get("retry", 0)
17821783

17831784
if entities_types is None:
17841785
entities_types = []
@@ -1819,7 +1820,10 @@ def _send_bundle(self, channel, bundle, **kwargs) -> None:
18191820
except (UnroutableError, NackError):
18201821
self.connector_logger.error("Unable to send bundle, retry...")
18211822
self.metric.inc("error_count")
1822-
self._send_bundle(channel, bundle, **kwargs)
1823+
retry = retry + 1
1824+
if retry < 5:
1825+
kwargs.setdefault("retry", retry)
1826+
self._send_bundle(channel, bundle, **kwargs)
18231827

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

0 commit comments

Comments
 (0)