From 48f86e91f7747bf77709216e1a5e51e1c39c14bd Mon Sep 17 00:00:00 2001 From: jokob-sk Date: Tue, 17 Dec 2024 22:25:45 +1100 Subject: [PATCH] Override init fix of schedules --- front/css/app.css | 5 +++++ front/devices.php | 6 ++++-- server/initialise.py | 11 ++++++++--- server/scheduler.py | 4 ++-- 4 files changed, 19 insertions(+), 7 deletions(-) diff --git a/front/css/app.css b/front/css/app.css index 5f5e3a06..e5575487 100755 --- a/front/css/app.css +++ b/front/css/app.css @@ -42,6 +42,11 @@ h5 cursor: help; } +.alignRight +{ + text-align: end; +} + /* ----------------------------------------------------------------------------- Text Classes ----------------------------------------------------------------------------- */ diff --git a/front/devices.php b/front/devices.php index 145b76c2..9ba2eb3e 100755 --- a/front/devices.php +++ b/front/devices.php @@ -631,9 +631,11 @@ function initializeDatatable (status) { ${cellData} - + + - + + `); } else { $(td).html (''); diff --git a/server/initialise.py b/server/initialise.py index 05f4fc3e..0bd25513 100755 --- a/server/initialise.py +++ b/server/initialise.py @@ -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)) # ----------------- diff --git a/server/scheduler.py b/server/scheduler.py index dbd94b7c..d59b58bf 100755 --- a/server/scheduler.py +++ b/server/scheduler.py @@ -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}')