From 89b97d7283693a0fe767ccf2f1e8580200871a38 Mon Sep 17 00:00:00 2001 From: Tobias Witek Date: Fri, 4 Nov 2016 19:01:19 +0100 Subject: [PATCH] [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. --- bumblebee/modules/dnf.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bumblebee/modules/dnf.py b/bumblebee/modules/dnf.py index bc40e94..65bcc6b 100644 --- a/bumblebee/modules/dnf.py +++ b/bumblebee/modules/dnf.py @@ -26,17 +26,17 @@ def get_dnf_info(obj): main = thread while main.is_alive(): - try: - res = subprocess.check_output(shlex.split("dnf updateinfo")) - except Exception as e: - break - loops += 1 time.sleep(1) if loops < obj.interval(): continue loops = 0 + try: + res = subprocess.check_output(shlex.split("dnf updateinfo")) + except Exception as e: + break + security = 0 bugfixes = 0