refactor: clean up health check and task access logic by removing unused code

This commit is contained in:
Your Name
2026-03-21 09:10:18 +02:00
parent f347022924
commit e1585216e6
4 changed files with 4 additions and 39 deletions

View File

@@ -1,10 +1,13 @@
"""Health check endpoint."""
from flask import Blueprint, jsonify
from app.extensions import limiter
health_bp = Blueprint("health", __name__)
@health_bp.route("/health", methods=["GET"])
@limiter.exempt
def health_check():
"""Simple health check — returns 200 if the service is running."""
return jsonify({

View File

@@ -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."