Skip to content

Commit 674f768

Browse files
papoteur-mgaConan-Kudo
authored andcommitted
Improve cache loading time at launch
When loading cache, time is lost in yui Event loop, instead of giving priority to heavy CPU consumming threads. In these cases, the change commute to a lower timeout, which can improve the loading time dividing it by 5. If we load cache outside a thread, the UI becomes unresponsive.
1 parent ce29aca commit 674f768

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

dnfdragora/ui.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1417,7 +1417,11 @@ def handleevent(self):
14171417
"""
14181418
self.running = True
14191419
while self.running == True:
1420-
event = self.dialog.waitForEvent(200)
1420+
loop_timeout = 20 if self._status in (DNFDragoraStatus.CACHING_AVAILABLE, \
1421+
DNFDragoraStatus.CACHING_UPDATE, \
1422+
DNFDragoraStatus.CACHING_INSTALLED) \
1423+
else 200
1424+
event = self.dialog.waitForEvent(loop_timeout)
14211425

14221426
eventType = event.eventType()
14231427

0 commit comments

Comments
 (0)