diff --git a/app/classes/shared/helpers.py b/app/classes/shared/helpers.py index 315959db..40a57219 100644 --- a/app/classes/shared/helpers.py +++ b/app/classes/shared/helpers.py @@ -76,6 +76,7 @@ class Helpers: self.websocket_helper = WebSocketHelper(self) self.translation = Translation(self) + self.update_available = False @staticmethod def auto_installer_fix(ex): diff --git a/app/classes/shared/tasks.py b/app/classes/shared/tasks.py index 49734d9d..fd22c74d 100644 --- a/app/classes/shared/tasks.py +++ b/app/classes/shared/tasks.py @@ -3,7 +3,7 @@ import time import logging import threading import asyncio -import datetime +from datetime import datetime from tzlocal import get_localzone from tzlocal.utils import ZoneInfoNotFoundError @@ -193,6 +193,14 @@ class TasksManager: schedules = HelpersManagement.get_schedules_enabled() self.scheduler.add_listener(self.schedule_watcher, mask=EVENT_JOB_EXECUTED) self.scheduler.start() + self.check_for_updates() + self.scheduler.add_job( + self.check_for_updates, + "interval", + hours=12, + id="update_watcher", + start_date=datetime.now(), + ) # self.scheduler.add_job( # self.scheduler.print_jobs, "interval", seconds=10, id="-1" # ) @@ -646,6 +654,10 @@ class TasksManager: ) time.sleep(1) + def check_for_updates(self): + self.helper.update_available = self.helper.check_remote_version() + print(self.helper.update_available) + def log_watcher(self): self.controller.servers.check_for_old_logs() self.scheduler.add_job(