mirror of
https://github.com/GNS3/gns3-server
synced 2025-01-04 21:20:55 +00:00
Remove websocket.close()
This commit is contained in:
parent
03b491f7b1
commit
31c7fe88f1
@ -50,11 +50,7 @@ async def project_ws_notifications(websocket: Union[None, WebSocket] = Depends(w
|
|||||||
log.info(f"Client {websocket.client.host}:{websocket.client.port} has disconnected from compute WebSocket")
|
log.info(f"Client {websocket.client.host}:{websocket.client.port} has disconnected from compute WebSocket")
|
||||||
except WebSocketException as e:
|
except WebSocketException as e:
|
||||||
log.warning(f"Error while sending to controller event to WebSocket client: {e}")
|
log.warning(f"Error while sending to controller event to WebSocket client: {e}")
|
||||||
finally:
|
|
||||||
try:
|
|
||||||
await websocket.close()
|
|
||||||
except OSError:
|
|
||||||
pass # ignore OSError: [Errno 107] Transport endpoint is not connected
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
||||||
|
@ -221,11 +221,6 @@ async def controller_ws_notifications(
|
|||||||
log.info(f"Client {websocket.client.host}:{websocket.client.port} has disconnected from controller WebSocket")
|
log.info(f"Client {websocket.client.host}:{websocket.client.port} has disconnected from controller WebSocket")
|
||||||
except WebSocketException as e:
|
except WebSocketException as e:
|
||||||
log.warning(f"Error while sending to controller event to WebSocket client: {e}")
|
log.warning(f"Error while sending to controller event to WebSocket client: {e}")
|
||||||
finally:
|
|
||||||
try:
|
|
||||||
await websocket.close()
|
|
||||||
except OSError:
|
|
||||||
pass # ignore OSError: [Errno 107] Transport endpoint is not connected
|
|
||||||
|
|
||||||
|
|
||||||
# @Route.post(
|
# @Route.post(
|
||||||
|
@ -305,10 +305,6 @@ async def project_ws_notifications(
|
|||||||
except WebSocketException as e:
|
except WebSocketException as e:
|
||||||
log.warning(f"Error while sending to project event to WebSocket client: {e}")
|
log.warning(f"Error while sending to project event to WebSocket client: {e}")
|
||||||
finally:
|
finally:
|
||||||
try:
|
|
||||||
await websocket.close()
|
|
||||||
except OSError:
|
|
||||||
pass # ignore OSError: [Errno 107] Transport endpoint is not connected
|
|
||||||
if project.auto_close:
|
if project.auto_close:
|
||||||
# To avoid trouble with client connecting disconnecting we sleep few seconds before checking
|
# To avoid trouble with client connecting disconnecting we sleep few seconds before checking
|
||||||
# if someone else is not connected
|
# if someone else is not connected
|
||||||
|
@ -182,7 +182,7 @@ class Server:
|
|||||||
asyncio.ensure_future(Controller.instance().reload())
|
asyncio.ensure_future(Controller.instance().reload())
|
||||||
else:
|
else:
|
||||||
log.info(f"Server has got signal {signame}, exiting...")
|
log.info(f"Server has got signal {signame}, exiting...")
|
||||||
# send SIGTERM to the server PID so uvicorn can shutdown the process
|
# send SIGTERM to the server PID so uvicorn can shut down the process
|
||||||
os.kill(os.getpid(), signal.SIGTERM)
|
os.kill(os.getpid(), signal.SIGTERM)
|
||||||
except asyncio.CancelledError:
|
except asyncio.CancelledError:
|
||||||
pass
|
pass
|
||||||
|
Loading…
Reference in New Issue
Block a user