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

Commit 809fda7

Browse files
committed
[client] Send heartbeat to AMQP in long tasks
1 parent fd818d1 commit 809fda7

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

pycti/connector/opencti_connector_helper.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ def _process_message(self, channel, method, properties, body) -> None:
228228
time_wait = 0
229229
# Wait for end of execution of the _data_handler
230230
while self.thread.is_alive(): # Loop while the thread is processing
231+
self.pika_connection.sleep(0.05)
231232
if (
232233
self.helper.work_id is not None and time_wait > five_minutes
233234
): # Ping every 5 minutes
@@ -312,10 +313,12 @@ def run(self) -> None:
312313
)
313314
self.channel.start_consuming()
314315
except (KeyboardInterrupt, SystemExit):
316+
self.channel.stop_consuming()
315317
LOGGER.info("Connector stop")
316318
sys.exit(0)
317319
except Exception as err: # pylint: disable=broad-except
318320
LOGGER.error("%s", err)
321+
self.pika_connection.close()
319322

320323
def stop(self):
321324
self.exit_event.set()

pycti/entities/opencti_indicator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ def __init__(self, opencti):
142142
}
143143
}
144144
"""
145-
self.properties = """
145+
self.properties_with_files = """
146146
id
147147
standard_id
148148
entity_type

0 commit comments

Comments
 (0)