From 0bdf2f96b5c5d41ee4bcfb46c2d6c4ff9ef7d82d Mon Sep 17 00:00:00 2001 From: paulfantom Date: Wed, 22 Jun 2016 12:40:11 +0200 Subject: [PATCH] Code formatting + fixed debug update_every --- plugins.d/python.d.plugin | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/plugins.d/python.d.plugin b/plugins.d/python.d.plugin index f0ff63f1..413b722e 100755 --- a/plugins.d/python.d.plugin +++ b/plugins.d/python.d.plugin @@ -425,7 +425,10 @@ class PythonCharts(object): since_last = 0 else: since_last = int((t_start - job.timetable['last']) * 1000000) - debug(job.chart_name + " ready to run, after " + str(int((t_start - job.timetable['last']) * 1000)) + " ms (update_every: " + str(job.timetable['freq'] * 1000) + " ms, latency: " + str(int((t_start - job.timetable['next']) * 1000)) + " ms)") + debug(job.chart_name + + " ready to run, after " + str(int((t_start - job.timetable['last']) * 1000)) + + " ms (update_every: " + str(job.timetable['freq'] * 1000) + + " ms, latency: " + str(int((t_start - job.timetable['next']) * 1000)) + " ms)") if not job.update(since_last): if job.retries_left <= 0: self._stop(job, "update failed") @@ -504,6 +507,7 @@ def parse_cmdline(directory, *commands): global OVERRIDE_UPDATE_EVERY global BASE_CONFIG + changed_update = False mods = [] for cmd in commands[1:]: if cmd == "check": @@ -517,11 +521,12 @@ def parse_cmdline(directory, *commands): else: try: BASE_CONFIG['update_every'] = int(cmd) - if DEBUG_FLAG: - OVERRIDE_UPDATE_EVERY = True - debug(PROGRAM, "overriding update interval to", str(int(cmd))) + changed_update = True except ValueError: pass + if changed_update and DEBUG_FLAG: + OVERRIDE_UPDATE_EVERY = True + debug(PROGRAM, "overriding update interval to", str(int(cmd))) debug("started from", commands[0], "with options:", *commands[1:]) -- 2.39.2