mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-07 20:54:15 +02:00
[view.core.controller] fix: search sometimes hanging when there is only one package type enabled
This commit is contained in:
@@ -14,6 +14,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
|||||||
### Fixes
|
### Fixes
|
||||||
- AppImage
|
- AppImage
|
||||||
- upgrade fails when the package was initially imported, but later added to bauh's database [#321](https://github.com/vinifmor/bauh/issues/321)
|
- upgrade fails when the package was initially imported, but later added to bauh's database [#321](https://github.com/vinifmor/bauh/issues/321)
|
||||||
|
- General
|
||||||
|
- search sometimes hanging when there is only one package type enabled
|
||||||
|
|
||||||
### Contributions
|
### Contributions
|
||||||
- German translations by [Mape6](https://github.com/Mape6)
|
- German translations by [Mape6](https://github.com/Mape6)
|
||||||
|
|||||||
@@ -144,7 +144,6 @@ class GenericSoftwareManager(SoftwareManager, SettingsController):
|
|||||||
return available
|
return available
|
||||||
|
|
||||||
def _search(self, word: str, is_url: bool, man: SoftwareManager, disk_loader, res: SearchResult):
|
def _search(self, word: str, is_url: bool, man: SoftwareManager, disk_loader, res: SearchResult):
|
||||||
if self._can_work(man):
|
|
||||||
mti = time.time()
|
mti = time.time()
|
||||||
apps_found = man.search(words=word, disk_loader=disk_loader, is_url=is_url, limit=-1)
|
apps_found = man.search(words=word, disk_loader=disk_loader, is_url=is_url, limit=-1)
|
||||||
mtf = time.time()
|
mtf = time.time()
|
||||||
@@ -171,6 +170,7 @@ class GenericSoftwareManager(SoftwareManager, SettingsController):
|
|||||||
threads = []
|
threads = []
|
||||||
|
|
||||||
for man in self.managers:
|
for man in self.managers:
|
||||||
|
if self._can_work(man):
|
||||||
t = Thread(target=self._search, args=(norm_query, is_url, man, disk_loader, res))
|
t = Thread(target=self._search, args=(norm_query, is_url, man, disk_loader, res))
|
||||||
t.start()
|
t.start()
|
||||||
threads.append(t)
|
threads.append(t)
|
||||||
|
|||||||
Reference in New Issue
Block a user