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)}