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

Commit d8d70f8

Browse files
[client] Adapt acknowledge strategy in connector helper
1 parent 1c06c7e commit d8d70f8

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

pycti/api/opencti_api_playbook.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import json
2-
31
from pycti.api import LOGGER
42

53

pycti/connector/opencti_connector_helper.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,6 @@ async def _process_message(self, channel, method, properties, body) -> None:
220220

221221
json_data = json.loads(body)
222222
work_id = json_data["internal"]["work_id"]
223-
channel.basic_ack(delivery_tag=method.delivery_tag)
224223
message_task = self._data_handler(json_data)
225224
five_minutes = 60 * 5
226225
time_wait = 0
@@ -240,6 +239,8 @@ async def _process_message(self, channel, method, properties, body) -> None:
240239
logging.exception("Error in message processing, reporting error to API")
241240
if work_id:
242241
self.helper.api.work.to_processed(work_id, str(e), True)
242+
finally:
243+
channel.basic_ack(delivery_tag=method.delivery_tag)
243244
LOGGER.info(
244245
"Message (delivery_tag=%s) processed, thread terminated",
245246
method.delivery_tag,

0 commit comments

Comments
 (0)