feat: make software-init threadsafe & concurrent

This commit is contained in:
Yannik Schmidt
2024-05-31 15:49:11 +02:00
parent 9008df2f3f
commit bcc3d39e31
2 changed files with 40 additions and 31 deletions

View File

@@ -30,7 +30,7 @@ class Software:
def _load_from_yaml(self):
content = self.backend.get(self.meta_file, self.cache_dir, return_content=True)
content = self.backend.get(self.meta_file, self.cache_dir, return_content=True, new_connection=True)
meta = yaml.safe_load(content)
if not meta:
@@ -46,10 +46,10 @@ class Software:
self.run_exe = meta.get("run_exe")
self.installer = meta.get("installer")
self.pictures = [ self.backend.get(pp, self.cache_dir) for pp in
self.backend.list(os.path.join(self.directory, "pictures"), fullpaths=True) ]
self.pictures = [ self.backend.get(pp, self.cache_dir, new_connection=True) for pp in
self.backend.list(os.path.join(self.directory, "pictures"), fullpaths=True, new_connection=True) ]
self.reg_files = self.backend.list(os.path.join(self.directory, "registry_files"), fullpaths=True)
self.reg_files = self.backend.list(os.path.join(self.directory, "registry_files"), fullpaths=True, new_connection=True)
def get_thumbnail(self):