From 381b790d118e1aaece07365092e07da09e402c46 Mon Sep 17 00:00:00 2001 From: Johannes Findeisen Date: Mon, 3 Oct 2022 05:47:13 +0200 Subject: [PATCH] Inline comments update. --- bin/linspector | 2 +- linspector/core/linspector.py | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/bin/linspector b/bin/linspector index 6f4f5a5..6efc4b6 100755 --- a/bin/linspector +++ b/bin/linspector @@ -34,7 +34,7 @@ from linspector.core.monitors import Monitors # i currently only increase the 3rd number because the goal is that 0.19 will become the first # stable version. -__version__ = '0.19.22.dev1' +__version__ = '0.19.23.dev1' __author__ = 'Johannes Findeisen ' logger = logging.getLogger('linspector') diff --git a/linspector/core/linspector.py b/linspector/core/linspector.py index af72590..8fed39b 100644 --- a/linspector/core/linspector.py +++ b/linspector/core/linspector.py @@ -80,6 +80,8 @@ class Linspector: else: time_delta = round(random.uniform(0.00, 60.000), 3) + # TODO: write get functions in the monitor to get options. do not call + # get_monitor_configuration_option() here (example: get_start_date()). if monitors.get(monitor).get_monitor_configuration_option('args', 'start_date'): new_start_date = \ monitors.get(monitor).get_monitor_configuration_option('args', 'start_date') @@ -88,11 +90,14 @@ class Linspector: monitor_job = monitors.get(monitor) interval = monitor_job.get_interval() + if configuration.get_option('linspector', 'timezone'): timezone = configuration.get_option('linspector', 'timezone') else: timezone = 'UTC' + # add cron and one time run jobs to Linspector. not only "interval" jobs should be + # supported. scheduler_job = scheduler['linspector'].add_job(job_function, 'interval', start_date=new_start_date, seconds=interval, timezone=timezone,