mirror of
https://github.com/GNS3/gns3-server
synced 2024-11-24 17:28:08 +00:00
parent
7a80dd6cb3
commit
29127895b9
@ -31,6 +31,13 @@ import gns3server.utils.get_resource
|
|||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
# To avoid strange bug later we switch the event loop before any other operation
|
||||||
|
if sys.platform.startswith("win"):
|
||||||
|
import asyncio
|
||||||
|
# use the Proactor event loop on Windows
|
||||||
|
loop = asyncio.ProactorEventLoop()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def daemonize():
|
def daemonize():
|
||||||
"""
|
"""
|
||||||
|
@ -177,11 +177,8 @@ class WebServer:
|
|||||||
logger = logging.getLogger("asyncio")
|
logger = logging.getLogger("asyncio")
|
||||||
logger.setLevel(logging.ERROR)
|
logger.setLevel(logging.ERROR)
|
||||||
|
|
||||||
server_config = Config.instance().get_section_config("Server")
|
|
||||||
if sys.platform.startswith("win"):
|
if sys.platform.startswith("win"):
|
||||||
# use the Proactor event loop on Windows
|
loop = asyncio.get_event_loop()
|
||||||
loop = asyncio.ProactorEventLoop()
|
|
||||||
|
|
||||||
# Add a periodic callback to give a chance to process signals on Windows
|
# Add a periodic callback to give a chance to process signals on Windows
|
||||||
# because asyncio.add_signal_handler() is not supported yet on that platform
|
# because asyncio.add_signal_handler() is not supported yet on that platform
|
||||||
# otherwise the loop runs outside of signal module's ability to trap signals.
|
# otherwise the loop runs outside of signal module's ability to trap signals.
|
||||||
@ -190,6 +187,9 @@ class WebServer:
|
|||||||
loop.call_later(0.5, wakeup)
|
loop.call_later(0.5, wakeup)
|
||||||
asyncio.set_event_loop(loop)
|
asyncio.set_event_loop(loop)
|
||||||
|
|
||||||
|
server_config = Config.instance().get_section_config("Server")
|
||||||
|
|
||||||
|
|
||||||
ssl_context = None
|
ssl_context = None
|
||||||
if server_config.getboolean("ssl"):
|
if server_config.getboolean("ssl"):
|
||||||
if sys.platform.startswith("win"):
|
if sys.platform.startswith("win"):
|
||||||
|
Loading…
Reference in New Issue
Block a user