Update requirements and insfra versions

This commit is contained in:
Urtzi Alfaro
2025-10-17 23:09:40 +02:00
parent 7e089b80cf
commit 312e36c893
81 changed files with 524 additions and 476 deletions

View File

@@ -311,6 +311,7 @@ async def websocket_training_progress(websocket: WebSocket, tenant_id: str, job_
try:
# Connect to training service WebSocket
import websockets
from websockets.protocol import State
training_ws = await websockets.connect(
training_ws_url,
@@ -325,7 +326,7 @@ async def websocket_training_progress(websocket: WebSocket, tenant_id: str, job_
async def forward_frontend_to_training():
"""Forward messages from frontend to training service"""
try:
while training_ws and training_ws.open:
while training_ws and training_ws.state == State.OPEN:
data = await websocket.receive()
if data.get("type") == "websocket.receive":
@@ -342,7 +343,7 @@ async def websocket_training_progress(websocket: WebSocket, tenant_id: str, job_
"""Forward messages from training service to frontend"""
message_count = 0
try:
while training_ws and training_ws.open:
while training_ws and training_ws.state == State.OPEN:
message = await training_ws.recv()
await websocket.send_text(message)
message_count += 1
@@ -369,7 +370,7 @@ async def websocket_training_progress(websocket: WebSocket, tenant_id: str, job_
logger.error("WebSocket proxy error", job_id=job_id, error=str(e))
finally:
# Cleanup
if training_ws and not training_ws.closed:
if training_ws and training_ws.state == State.OPEN:
try:
await training_ws.close()
except: