refactor(scheduler): replace structlog with std logging and add extensive diagnostics
- Switch scheduler_service from structlog to standard logging for consistency - Add detailed lifecycle logging in SchedulerService (start, stop, rescan) - Add debug logging in fastapi_app scheduler initialization - Fix test_add_series_episodes to mock EpisodeService.get_by_series
This commit is contained in:
@@ -121,7 +121,7 @@ async def _run_startup_health_checks(logger) -> dict:
|
||||
import asyncio
|
||||
import shutil
|
||||
import socket
|
||||
from typing import Dict, Any
|
||||
from typing import Any, Dict
|
||||
|
||||
checks: Dict[str, Any] = {
|
||||
"ffmpeg": {"status": "unknown", "message": None},
|
||||
@@ -400,13 +400,15 @@ async def lifespan(_application: FastAPI):
|
||||
|
||||
# Initialize and start scheduler service
|
||||
try:
|
||||
logger.info("Initializing scheduler service...")
|
||||
from src.server.services.scheduler_service import (
|
||||
get_scheduler_service,
|
||||
)
|
||||
scheduler_service = get_scheduler_service()
|
||||
logger.info("Scheduler service instance obtained, starting...")
|
||||
await scheduler_service.start()
|
||||
initialized['scheduler'] = True
|
||||
logger.info("Scheduler service started")
|
||||
logger.info("Scheduler service started successfully")
|
||||
except Exception as e:
|
||||
logger.warning("Failed to start scheduler service: %s", e)
|
||||
# Continue - scheduler is optional
|
||||
|
||||
Reference in New Issue
Block a user