From 7cc1d6e0326a19fdaa6bbc2a70cd7c287205a22b Mon Sep 17 00:00:00 2001 From: Philippe Damoune Date: Mon, 18 Aug 2025 10:06:24 +0200 Subject: [PATCH] [client]: unify empty state handling --- pycti/connector/opencti_connector_helper.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pycti/connector/opencti_connector_helper.py b/pycti/connector/opencti_connector_helper.py index 48ffae4c9..76ebfb515 100644 --- a/pycti/connector/opencti_connector_helper.py +++ b/pycti/connector/opencti_connector_helper.py @@ -783,9 +783,10 @@ def run(self) -> None: # pylint: disable=too-many-branches # state can be None if reset from the UI # In this case, default parameters will be used but SSE Client needs to be restarted if state is None: - self.exit = True - state["start_from"] = str(msg.id) - self.helper.set_state(state) + self.exit_event.set() + else: + state["start_from"] = str(msg.id) + self.helper.set_state(state) except Exception as ex: self.helper.connector_logger.error( "Error in ListenStream loop, exit.", {"reason": str(ex)}