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

Commit e587149

Browse files
author
Samuel Hassine
committed
[client] Allow one shot in connectors
1 parent 1db947c commit e587149

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

pycti/connector/opencti_connector_helper.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,13 @@ def __init__(self, config: Dict) -> None:
420420
self.log_level = get_config_variable(
421421
"CONNECTOR_LOG_LEVEL", ["connector", "log_level"], config
422422
)
423+
self.connect_run_and_terminate = get_config_variable(
424+
"CONNECTOR_RUN_AND_TERMINATE",
425+
["connector", "run_and_terminate"],
426+
config,
427+
False,
428+
False,
429+
)
423430

424431
# Configure logger
425432
numeric_level = getattr(
@@ -451,10 +458,11 @@ def __init__(self, config: Dict) -> None:
451458
self.config = connector_configuration["config"]
452459

453460
# Start ping thread
454-
self.ping = PingAlive(
455-
self.connector.id, self.api, self.get_state, self.set_state
456-
)
457-
self.ping.start()
461+
if not self.connect_run_and_terminate:
462+
self.ping = PingAlive(
463+
self.connector.id, self.api, self.get_state, self.set_state
464+
)
465+
self.ping.start()
458466

459467
# self.listen_stream = None
460468
self.listen_queue = None

0 commit comments

Comments
 (0)