[improvement][arch] faster caching data process during initialization

This commit is contained in:
Vinícius Moreira
2020-05-15 16:55:48 -03:00
parent 23284f7ffe
commit 2f55793e8d
5 changed files with 51 additions and 17 deletions

View File

@@ -14,11 +14,10 @@ RE_CLEAN_NAME = re.compile(r'[+*?%]')
def write(pkg: ArchPackage):
data = pkg.get_data_to_cache()
if data:
Path(pkg.get_disk_cache_path()).mkdir(parents=True, exist_ok=True)
Path(pkg.get_disk_cache_path()).mkdir(parents=True, exist_ok=True)
with open(pkg.get_disk_data_path(), 'w+') as f:
f.write(json.dumps(data))
with open(pkg.get_disk_data_path(), 'w+') as f:
f.write(json.dumps(data))
def fill_icon_path(pkg: ArchPackage, icon_paths: List[str], only_exact_match: bool):