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

Makes sure the loop is running when closing the app.

This commit is contained in:
Jeremy 2015-07-26 15:28:14 -06:00
parent 7b001e4d36
commit 4aeb451ffd

View File

@ -252,7 +252,8 @@ class Server:
# TypeError: async() takes 1 positional argument but 3 were given
log.warning("TypeError exception in the loop {}".format(e))
finally:
if self._handler:
if self._handler and self._loop.is_running():
self._loop.run_until_complete(self._handler.finish_connections())
server.close()
self._loop.run_until_complete(app.finish())
if self._loop.is_running():
self._loop.run_until_complete(app.finish())