1 parent 1c06c7e commit d8d70f8Copy full SHA for d8d70f8
2 files changed
pycti/api/opencti_api_playbook.py
@@ -1,5 +1,3 @@
1
-import json
2
-
3
from pycti.api import LOGGER
4
5
pycti/connector/opencti_connector_helper.py
@@ -220,7 +220,6 @@ async def _process_message(self, channel, method, properties, body) -> None:
220
221
json_data = json.loads(body)
222
work_id = json_data["internal"]["work_id"]
223
- channel.basic_ack(delivery_tag=method.delivery_tag)
224
message_task = self._data_handler(json_data)
225
five_minutes = 60 * 5
226
time_wait = 0
@@ -240,6 +239,8 @@ async def _process_message(self, channel, method, properties, body) -> None:
240
239
logging.exception("Error in message processing, reporting error to API")
241
if work_id:
242
self.helper.api.work.to_processed(work_id, str(e), True)
+ finally:
243
+ channel.basic_ack(delivery_tag=method.delivery_tag)
244
LOGGER.info(
245
"Message (delivery_tag=%s) processed, thread terminated",
246
method.delivery_tag,
0 commit comments