mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-10-28 18:45:43 +00:00
Sure sonar
This commit is contained in:
1 file changed
+6
-7
@@ -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
|
||||
|
||||
Reference in new issue
Block a user