Websocket fix 3
This commit is contained in:
@@ -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}")
|
||||
|
||||
Reference in New Issue
Block a user