Fix #167, #161 and #156, implemented #155

This commit is contained in:
Xoconoch
2025-06-09 18:18:19 -06:00
parent ca77c0e9f3
commit 66da8cef5c
14 changed files with 1051 additions and 273 deletions

View File

@@ -127,6 +127,7 @@ class CeleryDownloadQueueManager:
NON_BLOCKING_STATES = [
ProgressState.COMPLETE,
ProgressState.DONE,
ProgressState.CANCELLED,
ProgressState.ERROR,
ProgressState.ERROR_RETRIED,
@@ -354,7 +355,11 @@ class CeleryDownloadQueueManager:
status = task.get("status")
# Only cancel tasks that are not already completed or cancelled
if status not in [ProgressState.COMPLETE, ProgressState.CANCELLED]:
if status not in [
ProgressState.COMPLETE,
ProgressState.DONE,
ProgressState.CANCELLED,
]:
result = cancel_celery_task(task_id)
if result.get("status") == "cancelled":
cancelled_count += 1