Fix missing ack_id when finishing task (#224)

* Update monitor.py

* format

---------

Co-authored-by: Stan Triepels <1939656+GDay@users.noreply.github.com>
This commit is contained in:
blockisec
2024-10-11 15:03:18 +02:00
committed by GitHub
parent c3b49cca25
commit dcfe5b6650

View File

@@ -145,7 +145,11 @@ def save_task(task, broker: Broker):
attempt_count=1,
)
if Conf.MAX_ATTEMPTS > 0 and task_obj.attempt_count >= Conf.MAX_ATTEMPTS:
if (
Conf.MAX_ATTEMPTS > 0
and task_obj.attempt_count >= Conf.MAX_ATTEMPTS
and task.get("ack_id")
):
broker.acknowledge(task["ack_id"])
except Exception: