1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-12-23 23:38:21 +00:00

Allow controller to reconnect to compute if communication is lost. Ref #1634

This commit is contained in:
grossmj 2020-03-19 18:02:01 +10:30
parent aa1b621c10
commit b24bb42a66

View File

@ -448,11 +448,11 @@ class Compute:
log.error("Error received on compute WebSocket '{}': {}".format(ws_url, ws.exception()))
elif response.type == aiohttp.WSMsgType.CLOSED:
pass
self._connected = False
break
except aiohttp.client_exceptions.ClientResponseError as e:
log.error("Client response error received on compute WebSocket '{}': {}".format(ws_url,e))
finally:
self._connected = False
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)