mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-09 08:44:15 +02:00
[arch] feature -> AUR: new custom action to quickly reinstall a package
This commit is contained in:
@@ -22,6 +22,7 @@ class AsyncDiskCacheLoader(Thread, DiskCacheLoader):
|
||||
self.cache_map = cache_map
|
||||
self.logger = logger
|
||||
self.processed = 0
|
||||
self._working = False
|
||||
|
||||
def fill(self, pkg: SoftwarePackage, sync: bool = False):
|
||||
"""
|
||||
@@ -31,7 +32,7 @@ class AsyncDiskCacheLoader(Thread, DiskCacheLoader):
|
||||
:return:
|
||||
"""
|
||||
if pkg and pkg.supports_disk_cache():
|
||||
if sync:
|
||||
if sync or not self._working:
|
||||
self._fill_cached_data(pkg)
|
||||
else:
|
||||
self.pkgs.append(pkg)
|
||||
@@ -40,6 +41,7 @@ class AsyncDiskCacheLoader(Thread, DiskCacheLoader):
|
||||
self._work = False
|
||||
|
||||
def run(self):
|
||||
self._working = True
|
||||
last = 0
|
||||
|
||||
while True:
|
||||
@@ -53,6 +55,8 @@ class AsyncDiskCacheLoader(Thread, DiskCacheLoader):
|
||||
elif not self._work:
|
||||
break
|
||||
|
||||
self._working = False
|
||||
|
||||
def _fill_cached_data(self, pkg: SoftwarePackage) -> bool:
|
||||
if os.path.exists(pkg.get_disk_data_path()):
|
||||
disk_path = pkg.get_disk_data_path()
|
||||
|
||||
Reference in New Issue
Block a user