Spaces:
Building
Building
Update websocket_handler.py
Browse files- websocket_handler.py +3 -4
websocket_handler.py
CHANGED
@@ -398,7 +398,7 @@ async def websocket_endpoint(websocket: WebSocket, session_id: str):
|
|
398 |
)
|
399 |
|
400 |
message_type = message.get("type")
|
401 |
-
|
402 |
|
403 |
if message_type == "audio_chunk":
|
404 |
await handle_audio_chunk(websocket, realtime_session, message)
|
@@ -407,12 +407,11 @@ async def websocket_endpoint(websocket: WebSocket, session_id: str):
|
|
407 |
await handle_control_message(websocket, realtime_session, message)
|
408 |
|
409 |
elif message_type == "ping":
|
410 |
-
# Keep-alive ping
|
411 |
await websocket.send_json({"type": "pong"})
|
412 |
-
log_debug(f"🏓 Ping-pong", session_id=session_id)
|
413 |
|
414 |
except asyncio.TimeoutError:
|
415 |
-
|
416 |
await websocket.send_json({"type": "ping"})
|
417 |
|
418 |
except WebSocketDisconnect as e:
|
|
|
398 |
)
|
399 |
|
400 |
message_type = message.get("type")
|
401 |
+
# Debug log'u kaldırdık
|
402 |
|
403 |
if message_type == "audio_chunk":
|
404 |
await handle_audio_chunk(websocket, realtime_session, message)
|
|
|
407 |
await handle_control_message(websocket, realtime_session, message)
|
408 |
|
409 |
elif message_type == "ping":
|
410 |
+
# Keep-alive ping - log yapmadan
|
411 |
await websocket.send_json({"type": "pong"})
|
|
|
412 |
|
413 |
except asyncio.TimeoutError:
|
414 |
+
# Timeout log'unu da azaltalım - her timeout'ta değil
|
415 |
await websocket.send_json({"type": "ping"})
|
416 |
|
417 |
except WebSocketDisconnect as e:
|