mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-07 09:36:05 -08:00
Override init fix of schedules
This commit is contained in:
@@ -42,6 +42,11 @@ h5
|
||||
cursor: help;
|
||||
}
|
||||
|
||||
.alignRight
|
||||
{
|
||||
text-align: end;
|
||||
}
|
||||
|
||||
/* -----------------------------------------------------------------------------
|
||||
Text Classes
|
||||
----------------------------------------------------------------------------- */
|
||||
|
||||
@@ -631,9 +631,11 @@ function initializeDatatable (status) {
|
||||
<a href="http://${cellData}" class="pointer" target="_blank">
|
||||
${cellData}
|
||||
</a>
|
||||
<a href="https://${cellData}" class="pointer" target="_blank">
|
||||
<span class="alignRight">
|
||||
<a href="https://${cellData}" class="pointer" target="_blank">
|
||||
<i class="fa fa-lock "></i>
|
||||
</a>
|
||||
</a>
|
||||
<span>
|
||||
<span>`);
|
||||
} else {
|
||||
$(td).html ('');
|
||||
|
||||
@@ -318,9 +318,14 @@ def importConfigs (db, all_plugins):
|
||||
# setup execution schedules AFTER OVERRIDE handling
|
||||
for plugin in all_plugins:
|
||||
# Setup schedules
|
||||
if get_set_value_for_init(plugin, c_d, "RUN") == 'schedule':
|
||||
newSchedule = Cron(get_set_value_for_init(plugin, c_d, "RUN_SCHD")).schedule(start_date=datetime.datetime.now(conf.tz))
|
||||
conf.mySchedules.append(schedule_class(pref, newSchedule, newSchedule.next(), False))
|
||||
run_val = get_set_value_for_init(plugin, c_d, "RUN")
|
||||
run_sch = get_set_value_for_init(plugin, c_d, "RUN_SCHD")
|
||||
|
||||
mylog('verbose', [f"[Config] pref {plugin["unique_prefix"]} run_val {run_val} run_sch {run_sch} "])
|
||||
|
||||
if run_val == 'schedule':
|
||||
newSchedule = Cron(run_sch).schedule(start_date=datetime.datetime.now(conf.tz))
|
||||
conf.mySchedules.append(schedule_class(plugin["unique_prefix"], newSchedule, newSchedule.next(), False))
|
||||
|
||||
|
||||
# -----------------
|
||||
|
||||
@@ -27,11 +27,11 @@ class schedule_class:
|
||||
# Run the schedule if the current time is past the schedule time we saved last time and
|
||||
# (maybe the following check is unnecessary)
|
||||
if nowTime > self.last_next_schedule:
|
||||
mylog('debug',f'[Scheduler] - Scheduler run for {self.service}: YES')
|
||||
mylog('debug',f'[Scheduler] run for {self.service}: YES')
|
||||
self.was_last_schedule_used = True
|
||||
result = True
|
||||
else:
|
||||
mylog('debug',f'[Scheduler] - Scheduler run for {self.service}: NO')
|
||||
mylog('debug',f'[Scheduler] run for {self.service}: NO')
|
||||
# mylog('debug',f'[Scheduler] - nowTime {nowTime}')
|
||||
# mylog('debug',f'[Scheduler] - self.last_next_schedule {self.last_next_schedule}')
|
||||
# mylog('debug',f'[Scheduler] - self.last_run {self.last_run}')
|
||||
|
||||
Reference in New Issue
Block a user