Sure sonar

This commit is contained in:
shamoon committed 2026-10-27 21:58:52 -07:00
1 parent 5d0197205f
commit dda60db9f1
1 file changed
+6 -7
+6 -7
View File
@@ -1381,17 +1381,16 @@ def task_revoked_handler(
return
try:
close_old_connections()
reason = "Task revoked before completion."
if expired:
reason = "Task expired before execution."
elif terminated:
reason = "Task terminated during execution."
PaperlessTask.objects.filter(task_id=task_id).update(
status=PaperlessTask.Status.REVOKED,
date_done=timezone.now(),
result_data={
"reason": (
"Task expired before execution. Check worker logs for details."
if expired
else "Task terminated during execution. Check worker logs for details."
if terminated
else "Task revoked before completion. Check worker logs for details."
),
"reason": (reason + " Check worker logs for details."),
},
)
except Exception: # pragma: no cover