refactor: clean up health check and task access logic by removing unused code
This commit is contained in:
@@ -11,7 +11,6 @@ from app.services.policy_service import (
|
||||
resolve_api_actor,
|
||||
resolve_web_actor,
|
||||
)
|
||||
from app.utils.auth import remember_task_access
|
||||
|
||||
tasks_bp = Blueprint("tasks", __name__)
|
||||
|
||||
@@ -53,17 +52,6 @@ def get_task_status(task_id: str):
|
||||
task_result = result.result or {}
|
||||
response["result"] = task_result
|
||||
|
||||
# Remember the file UUID in the session so the download route can verify access.
|
||||
# The download URL contains a different UUID than the Celery task ID.
|
||||
download_url = task_result.get("download_url", "")
|
||||
if download_url:
|
||||
parts = download_url.split("/")
|
||||
# URL format: /api/download/<file_uuid>/<filename>
|
||||
if len(parts) >= 4:
|
||||
file_uuid = parts[3]
|
||||
if file_uuid != task_id:
|
||||
remember_task_access(file_uuid)
|
||||
|
||||
elif result.state == "FAILURE":
|
||||
response["error"] = str(result.info) if result.info else "Task failed."
|
||||
|
||||
|
||||
Reference in New Issue
Block a user