feat(T08): Bildretusche via Flux.1-Pro + Preisvergleich + Retouch UI with before/after slider

This commit is contained in:
2026-07-17 09:31:28 +02:00
parent 5cc9f8e9a9
commit f1d6de0e47
16 changed files with 2278 additions and 30 deletions
+38
View File
@@ -0,0 +1,38 @@
"""Async retouch processing background task.
Creates its own DB session independent of the request session so the
HTTP response can return immediately while processing continues.
"""
from __future__ import annotations
import logging
import uuid
from typing import Any
from app.database import async_session_factory
from app.services.retouch_service import process_retouch
logger = logging.getLogger(__name__)
async def run_retouch_processing(
result_id: uuid.UUID,
vehicle_info: dict[str, Any] | None = None,
) -> None:
"""Background task: process retouch result asynchronously.
Creates its own DB session (independent of the request session)
so the HTTP response can return immediately.
"""
async with async_session_factory() as session:
try:
await process_retouch(session, result_id, vehicle_info)
await session.commit()
logger.info("Retouch processing completed for result %s", result_id)
except Exception as exc:
await session.rollback()
logger.error("Retouch background task failed for %s: %s", result_id, exc)
raise
finally:
await session.close()