mirror of
https://github.com/GNS3/gns3-server
synced 2024-11-12 19:38:57 +00:00
parent
8352ff02a1
commit
f93e443548
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user