1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-11-28 11:18:11 +00:00

Close and remove projects deleted from disks after SIGHUP signal is received.

This commit is contained in:
grossmj 2020-12-04 16:17:28 +10:30
parent 5244ae6d4c
commit 6c3a070733

View File

@ -145,6 +145,14 @@ class Controller:
log.info("Controller is reloading") log.info("Controller is reloading")
self._load_controller_settings() self._load_controller_settings()
# remove all projects deleted from disk.
for project in self._projects.copy().values():
if not os.path.exists(project.path):
log.info(f"Project '{project.name}' doesn't exist on the disk anymore, closing...")
await project.close()
self.remove_project(project)
await self.load_projects() await self.load_projects()
def check_can_write_config(self): def check_can_write_config(self):