1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-11-24 17:28:08 +00:00

Prevent close server process to be started twice

Fix #652
This commit is contained in:
Julien Duponchelle 2016-08-26 14:14:19 +02:00
parent 8352ff02a1
commit f93e443548
No known key found for this signature in database
GPG Key ID: CE8B29639E07F5E8

View File

@ -60,6 +60,7 @@ class WebServer:
self._start_time = time.time()
self._port_manager = PortManager(host)
self._running = False
self._closing = False
@staticmethod
def instance(host=None, port=None):
@ -92,6 +93,12 @@ class WebServer:
Cleanly shutdown the server.
"""
if not self._closing:
self._closing = True
else:
log.warning("Close is already in progress")
return
if self._handler:
yield from self._handler.finish_connections()
self._handler = None