Websocket fix 3

This commit is contained in:
Urtzi Alfaro
2025-08-01 20:43:02 +02:00
parent 37938b614f
commit 6e6c2cc42e
4 changed files with 180 additions and 621 deletions

View File

@@ -8,6 +8,7 @@ import asyncio
from typing import Dict, Any
from fastapi import WebSocket, WebSocketDisconnect, Depends, HTTPException
from fastapi.routing import APIRouter
import datetime
import structlog
logger = structlog.get_logger(__name__)
@@ -157,7 +158,7 @@ async def training_progress_websocket(
await websocket.send_json({
"type": "heartbeat",
"job_id": job_id,
"timestamp": datetime.utcnow().isoformat()
"timestamp": str(datetime.datetime.now())
})
except Exception as e:
logger.error(f"Failed to send heartbeat for job {job_id}: {e}")