[modules/dnf] Only do update check every 'interval'

Yet another bug in the DNF module - really a troublesome one. Only call
the dnf updateinfo every interval, not every second. That significantly
reduces CPU load.
This commit is contained in:
Tobias Witek 2016-11-04 19:01:19 +01:00
parent 1f440673a8
commit 89b97d7283

View file

@ -26,17 +26,17 @@ def get_dnf_info(obj):
main = thread main = thread
while main.is_alive(): while main.is_alive():
try:
res = subprocess.check_output(shlex.split("dnf updateinfo"))
except Exception as e:
break
loops += 1 loops += 1
time.sleep(1) time.sleep(1)
if loops < obj.interval(): if loops < obj.interval():
continue continue
loops = 0 loops = 0
try:
res = subprocess.check_output(shlex.split("dnf updateinfo"))
except Exception as e:
break
security = 0 security = 0
bugfixes = 0 bugfixes = 0