mirror of
https://github.com/GNS3/gns3-server.git
synced 2025-06-15 05:48:11 +00:00
Allow controller to reconnect to compute if communication is lost. Ref #1634
This commit is contained in:
@ -448,11 +448,11 @@ class Compute:
|
|||||||
log.error("Error received on compute WebSocket '{}': {}".format(ws_url, ws.exception()))
|
log.error("Error received on compute WebSocket '{}': {}".format(ws_url, ws.exception()))
|
||||||
elif response.type == aiohttp.WSMsgType.CLOSED:
|
elif response.type == aiohttp.WSMsgType.CLOSED:
|
||||||
pass
|
pass
|
||||||
self._connected = False
|
|
||||||
break
|
break
|
||||||
except aiohttp.client_exceptions.ClientResponseError as e:
|
except aiohttp.client_exceptions.ClientResponseError as e:
|
||||||
log.error("Client response error received on compute WebSocket '{}': {}".format(ws_url,e))
|
log.error("Client response error received on compute WebSocket '{}': {}".format(ws_url,e))
|
||||||
finally:
|
finally:
|
||||||
|
self._connected = False
|
||||||
log.info("Connection closed to compute WebSocket '{}'".format(ws_url))
|
log.info("Connection closed to compute WebSocket '{}'".format(ws_url))
|
||||||
|
|
||||||
# Try to reconnect after 1 second if server unavailable only if not during tests (otherwise we create a ressources usage bomb)
|
# Try to reconnect after 1 second if server unavailable only if not during tests (otherwise we create a ressources usage bomb)
|
||||||
|
Reference in New Issue
Block a user