mirror of
https://github.com/GNS3/gns3-server
synced 2024-11-24 17:28:08 +00:00
parent
8352ff02a1
commit
f93e443548
@ -60,6 +60,7 @@ class WebServer:
|
|||||||
self._start_time = time.time()
|
self._start_time = time.time()
|
||||||
self._port_manager = PortManager(host)
|
self._port_manager = PortManager(host)
|
||||||
self._running = False
|
self._running = False
|
||||||
|
self._closing = False
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def instance(host=None, port=None):
|
def instance(host=None, port=None):
|
||||||
@ -92,6 +93,12 @@ class WebServer:
|
|||||||
Cleanly shutdown the server.
|
Cleanly shutdown the server.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
if not self._closing:
|
||||||
|
self._closing = True
|
||||||
|
else:
|
||||||
|
log.warning("Close is already in progress")
|
||||||
|
return
|
||||||
|
|
||||||
if self._handler:
|
if self._handler:
|
||||||
yield from self._handler.finish_connections()
|
yield from self._handler.finish_connections()
|
||||||
self._handler = None
|
self._handler = None
|
||||||
|
Loading…
Reference in New Issue
Block a user