Update 2026-04-20 09:48:01

This commit is contained in:
kassam 2026-04-20 09:48:02 +04:00
parent 41433c2077
commit 71c45027f5
3 changed files with 7 additions and 4 deletions

View File

@ -18,12 +18,13 @@ editor, commented via "_comment" keys. No third-party dep.
from __future__ import annotations from __future__ import annotations
import json import json
import logging
import threading import threading
from pathlib import Path from pathlib import Path
from typing import Any from typing import Any
log = logging.getLogger("config_loader") from Project.Sanad.core.logger import get_logger
log = get_logger("config_loader")
# Resolved at first-load time (avoids circular import with config.py) # Resolved at first-load time (avoids circular import with config.py)
_BASE_DIR: Path | None = None _BASE_DIR: Path | None = None

View File

@ -12,10 +12,12 @@ from fastapi.responses import FileResponse
from pydantic import BaseModel from pydantic import BaseModel
from Project.Sanad.config import MOTIONS_DIR from Project.Sanad.config import MOTIONS_DIR
from Project.Sanad.core.logger import get_logger
from Project.Sanad.dashboard.routes._safe_io import ( from Project.Sanad.dashboard.routes._safe_io import (
safe_path_under, check_upload_size, atomic_write_bytes, safe_path_under, check_upload_size, atomic_write_bytes,
) )
log = get_logger("replay_route")
router = APIRouter() router = APIRouter()
@ -102,8 +104,7 @@ async def test_replay(payload: ReplayRequest):
try: try:
await asyncio.to_thread(arm.replay_file, str(path), payload.speed) await asyncio.to_thread(arm.replay_file, str(path), payload.speed)
except Exception: except Exception:
from Project.Sanad.core.logger import get_logger log.exception("Test replay failed")
get_logger("replay_route").exception("Test replay failed")
task = asyncio.create_task(_run()) task = asyncio.create_task(_run())
_BG_TASKS.add(task) _BG_TASKS.add(task)

View File

@ -78,6 +78,7 @@ async def generate_speech(payload: TextPayload):
try: try:
await voice_client.connect() await voice_client.connect()
except Exception: except Exception:
log.exception("Gemini reconnect failed in /generate")
raise HTTPException(503, "Gemini not connected and reconnect failed.") raise HTTPException(503, "Gemini not connected and reconnect failed.")
# Check session ownership — TypedReplay or live loop may hold it # Check session ownership — TypedReplay or live loop may hold it
if voice_client.session_owner is not None: if voice_client.session_owner is not None: