mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-09-30 07:40:12 +03:00
fix(typing): resolve mypy errors in api.routes.compute.notifications
This commit is contained in:
parent
f94a0cae0d
commit
5fb2c277a9
@ -39,14 +39,15 @@ async def project_ws_notifications(websocket: Union[None, WebSocket] = Depends(w
|
||||
"""
|
||||
|
||||
if websocket:
|
||||
log.info(f"New client {websocket.client.host}:{websocket.client.port} has connected to compute WebSocket")
|
||||
client = f"{websocket.client.host}:{websocket.client.port}" if websocket.client else "unknown"
|
||||
log.info(f"New client {client} has connected to compute WebSocket")
|
||||
try:
|
||||
with NotificationManager.instance().queue() as queue:
|
||||
while True:
|
||||
notification = await queue.get_json(5)
|
||||
await websocket.send_text(notification)
|
||||
except (ConnectionClosed, WebSocketDisconnect):
|
||||
log.info(f"Client {websocket.client.host}:{websocket.client.port} has disconnected from compute WebSocket")
|
||||
log.info(f"Client {client} has disconnected from compute WebSocket")
|
||||
except WebSocketException as e:
|
||||
log.warning(f"Error while sending to controller event to WebSocket client: {e}")
|
||||
|
||||
|
||||
@ -331,7 +331,6 @@ module = [
|
||||
"gns3server.api.routes.compute.frame_relay_switch_nodes", # 9
|
||||
"gns3server.api.routes.compute.iou_nodes", # 15
|
||||
"gns3server.api.routes.compute.nat_nodes", # 10
|
||||
"gns3server.api.routes.compute.notifications", # 4
|
||||
"gns3server.api.routes.compute.projects", # 7
|
||||
"gns3server.api.routes.compute.qemu_nodes", # 18
|
||||
"gns3server.api.routes.compute.virtualbox_nodes", # 20
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user