feat: Add status and error fields to TTS model and implement background processing for TTS generations

This commit is contained in:
JSC
2025-09-21 14:39:41 +02:00
parent b2e513a915
commit 72ddd98b25
6 changed files with 365 additions and 3 deletions

View File

@@ -12,6 +12,7 @@ from app.core.logging import get_logger, setup_logging
from app.core.services import app_services
from app.middleware.logging import LoggingMiddleware
from app.services.extraction_processor import extraction_processor
from app.services.tts_processor import tts_processor
from app.services.player import (
get_player_service,
initialize_player_service,
@@ -35,6 +36,10 @@ async def lifespan(_app: FastAPI) -> AsyncGenerator[None]:
await extraction_processor.start()
logger.info("Extraction processor started")
# Start the TTS processor
await tts_processor.start()
logger.info("TTS processor started")
# Start the player service
await initialize_player_service(get_session_factory())
logger.info("Player service started")
@@ -65,6 +70,10 @@ async def lifespan(_app: FastAPI) -> AsyncGenerator[None]:
await shutdown_player_service()
logger.info("Player service stopped")
# Stop the TTS processor
await tts_processor.stop()
logger.info("TTS processor stopped")
# Stop the extraction processor
await extraction_processor.stop()
logger.info("Extraction processor stopped")