Inline comments update.
This commit is contained in:
parent
1201da64f8
commit
381b790d11
2 changed files with 6 additions and 1 deletions
|
|
@ -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
|
# i currently only increase the 3rd number because the goal is that 0.19 will become the first
|
||||||
# stable version.
|
# stable version.
|
||||||
__version__ = '0.19.22.dev1'
|
__version__ = '0.19.23.dev1'
|
||||||
__author__ = 'Johannes Findeisen <you@hanez.org>'
|
__author__ = 'Johannes Findeisen <you@hanez.org>'
|
||||||
|
|
||||||
logger = logging.getLogger('linspector')
|
logger = logging.getLogger('linspector')
|
||||||
|
|
|
||||||
|
|
@ -80,6 +80,8 @@ class Linspector:
|
||||||
else:
|
else:
|
||||||
time_delta = round(random.uniform(0.00, 60.000), 3)
|
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'):
|
if monitors.get(monitor).get_monitor_configuration_option('args', 'start_date'):
|
||||||
new_start_date = \
|
new_start_date = \
|
||||||
monitors.get(monitor).get_monitor_configuration_option('args', 'start_date')
|
monitors.get(monitor).get_monitor_configuration_option('args', 'start_date')
|
||||||
|
|
@ -88,11 +90,14 @@ class Linspector:
|
||||||
|
|
||||||
monitor_job = monitors.get(monitor)
|
monitor_job = monitors.get(monitor)
|
||||||
interval = monitor_job.get_interval()
|
interval = monitor_job.get_interval()
|
||||||
|
|
||||||
if configuration.get_option('linspector', 'timezone'):
|
if configuration.get_option('linspector', 'timezone'):
|
||||||
timezone = configuration.get_option('linspector', 'timezone')
|
timezone = configuration.get_option('linspector', 'timezone')
|
||||||
else:
|
else:
|
||||||
timezone = 'UTC'
|
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',
|
scheduler_job = scheduler['linspector'].add_job(job_function, 'interval',
|
||||||
start_date=new_start_date,
|
start_date=new_start_date,
|
||||||
seconds=interval, timezone=timezone,
|
seconds=interval, timezone=timezone,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue