Override init fix of schedules

This commit is contained in:
jokob-sk
2024-12-17 22:25:45 +11:00
parent 3cc4caa34c
commit 48f86e91f7
4 changed files with 19 additions and 7 deletions
+5
View File
@@ -42,6 +42,11 @@ h5
cursor: help; cursor: help;
} }
.alignRight
{
text-align: end;
}
/* ----------------------------------------------------------------------------- /* -----------------------------------------------------------------------------
Text Classes Text Classes
----------------------------------------------------------------------------- */ ----------------------------------------------------------------------------- */
+4 -2
View File
@@ -631,9 +631,11 @@ function initializeDatatable (status) {
<a href="http://${cellData}" class="pointer" target="_blank"> <a href="http://${cellData}" class="pointer" target="_blank">
${cellData} ${cellData}
</a> </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> <i class="fa fa-lock "></i>
</a> </a>
<span>
<span>`); <span>`);
} else { } else {
$(td).html (''); $(td).html ('');
+8 -3
View File
@@ -318,9 +318,14 @@ def importConfigs (db, all_plugins):
# setup execution schedules AFTER OVERRIDE handling # setup execution schedules AFTER OVERRIDE handling
for plugin in all_plugins: for plugin in all_plugins:
# Setup schedules # Setup schedules
if get_set_value_for_init(plugin, c_d, "RUN") == 'schedule': run_val = get_set_value_for_init(plugin, c_d, "RUN")
newSchedule = Cron(get_set_value_for_init(plugin, c_d, "RUN_SCHD")).schedule(start_date=datetime.datetime.now(conf.tz)) run_sch = get_set_value_for_init(plugin, c_d, "RUN_SCHD")
conf.mySchedules.append(schedule_class(pref, newSchedule, newSchedule.next(), False))
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))
# ----------------- # -----------------
+2 -2
View File
@@ -27,11 +27,11 @@ class schedule_class:
# Run the schedule if the current time is past the schedule time we saved last time and # Run the schedule if the current time is past the schedule time we saved last time and
# (maybe the following check is unnecessary) # (maybe the following check is unnecessary)
if nowTime > self.last_next_schedule: 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 self.was_last_schedule_used = True
result = True result = True
else: 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] - nowTime {nowTime}')
# mylog('debug',f'[Scheduler] - self.last_next_schedule {self.last_next_schedule}') # mylog('debug',f'[Scheduler] - self.last_next_schedule {self.last_next_schedule}')
# mylog('debug',f'[Scheduler] - self.last_run {self.last_run}') # mylog('debug',f'[Scheduler] - self.last_run {self.last_run}')