Fix project auto open feature. Fixes #2455

This commit is contained in:
grossmj 2024-12-18 18:40:31 +07:00
parent 0dd53d3178
commit 648ae231ef
No known key found for this signature in database
GPG Key ID: 1E7DD6DBB53FF3D7

View File

@ -134,7 +134,9 @@ class Controller:
log.warning(str(e)) log.warning(str(e))
await self.load_projects() await self.load_projects()
await self._project_auto_open()
# start to auto open projects (if configured) 5 seconds after the controller has started
asyncio.get_event_loop().call_later(5, asyncio.create_task, self._project_auto_open())
def _create_ssl_context(self, server_config): def _create_ssl_context(self, server_config):
@ -595,9 +597,12 @@ class Controller:
Auto open the project with auto open enable Auto open the project with auto open enable
""" """
for project in self._projects.values(): try:
if project.auto_open: for project in self._projects.values():
await project.open() if project.auto_open:
await project.open()
except ControllerError as e:
log.error(f"Could not auto open projects: {e}")
def get_free_project_name(self, base_name): def get_free_project_name(self, base_name):
""" """