mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
4 files changed
+11
-3
No files matched your search
@@ -99,7 +99,11 @@ class Controller:
|
||||
for c in data["computes"]:
|
||||
yield from self.add_compute(**c)
|
||||
|
||||
# Preload the list of projects from disk
|
||||
@asyncio.coroutine
|
||||
def load_projects(self):
|
||||
"""
|
||||
Preload the list of projects from disk
|
||||
"""
|
||||
server_config = Config.instance().get_section_config("Server")
|
||||
projects_path = os.path.expanduser(server_config.get("projects_path", "~/GNS3/projects"))
|
||||
os.makedirs(projects_path, exist_ok=True)
|
||||
|
||||
@@ -292,10 +292,15 @@ class WebServer:
|
||||
log.info("Starting server on {}:{}".format(self._host, self._port))
|
||||
self._handler = app.make_handler(handler=RequestHandler)
|
||||
server = self._run_application(self._handler, ssl_context)
|
||||
|
||||
self._loop.run_until_complete(server)
|
||||
self._signal_handling()
|
||||
self._exit_handling()
|
||||
|
||||
# Now the compute is initialized we can load the projects
|
||||
if server_config.getboolean("controller"):
|
||||
asyncio.async(Controller.instance().load_projects())
|
||||
|
||||
if server_config.getboolean("shell"):
|
||||
asyncio.async(self.start_shell())
|
||||
|
||||
|
||||
Reference in new issue
Block a user