From 20aa859c8ece29f3b57c50d52ea58206c17d2926 Mon Sep 17 00:00:00 2001 From: Ben Finklea Date: Sun, 25 Jan 2026 14:24:24 -0600 Subject: [PATCH] Fix scheduler to read check interval from config each cycle Previously the scheduler used the instance variable set at initialization, ignoring config changes. Now it reads check_interval_hours from the config database each cycle, allowing users to change the interval without restarting. Co-Authored-By: Claude Opus 4.5 --- lib/update_scheduler.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/update_scheduler.py b/lib/update_scheduler.py index 4720df3..e65f23f 100644 --- a/lib/update_scheduler.py +++ b/lib/update_scheduler.py @@ -114,8 +114,9 @@ class UpdateScheduler: try: while not self._stop_event.is_set(): - # Check if auto-update is enabled + # Read current config values (so changes take effect) auto_enabled = self.store.get_config("auto_update_enabled", "false") + interval_hours = float(self.store.get_config("check_interval_hours", "24")) if auto_enabled.lower() == "true": # Run the check @@ -124,13 +125,11 @@ class UpdateScheduler: # Process any pending auto-updates self._loop.run_until_complete(self._download_pending_updates()) - # Calculate next check time - self._state.next_check = datetime.now() + timedelta( - hours=self.check_interval_hours - ) + # Calculate next check time using config value + self._state.next_check = datetime.now() + timedelta(hours=interval_hours) # Wait for interval or stop signal - interval_seconds = self.check_interval_hours * 3600 + interval_seconds = interval_hours * 3600 self._stop_event.wait(timeout=interval_seconds) finally: