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: