mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-09-30 19:33:45 +08:00
Automatic updates
This commit is contained in:
@@ -9,6 +9,7 @@ from openpilot.common.realtime import DT_MDL, Priority, Ratekeeper, config_realt
|
||||
from openpilot.common.time_helpers import system_time_valid
|
||||
|
||||
from openpilot.frogpilot.common.frogpilot_backups import backup_toggles
|
||||
from openpilot.frogpilot.common.frogpilot_functions import update_openpilot
|
||||
from openpilot.frogpilot.common.frogpilot_utilities import ThreadManager, is_url_pingable
|
||||
from openpilot.frogpilot.common.frogpilot_variables import FrogPilotVariables
|
||||
from openpilot.frogpilot.controls.frogpilot_planner import FrogPilotPlanner
|
||||
@@ -31,6 +32,9 @@ def update_checks(now, thread_manager, params, params_memory, frogpilot_toggles,
|
||||
while not (is_url_pingable("https://github.com") or is_url_pingable("https://gitlab.com")):
|
||||
time.sleep(60)
|
||||
|
||||
if frogpilot_toggles.automatic_updates:
|
||||
thread_manager.run_with_lock(update_openpilot, (thread_manager, params))
|
||||
|
||||
time.sleep(1)
|
||||
|
||||
def update_toggles(frogpilot_variables, started, thread_manager, time_validated, params):
|
||||
@@ -102,6 +106,7 @@ def frogpilot_thread():
|
||||
if params_memory.get_bool("FrogPilotTogglesUpdated"):
|
||||
frogpilot_toggles = update_toggles(frogpilot_variables, started, thread_manager, time_validated, params)
|
||||
|
||||
run_update_checks |= params_memory.get_bool("ManualUpdateInitiated")
|
||||
run_update_checks |= now.second == 0 and (now.minute % 60 == 0)
|
||||
run_update_checks &= time_validated
|
||||
|
||||
|
||||
Reference in New Issue
Block a user