mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-06-24 23:42:05 +08:00
thermald: prevent started cycling too quickly (#25971)
* thermald: prevent started cycling too quickly * move that * fix logging and no wait after boot Co-authored-by: Comma Device <device@comma.ai>
This commit is contained in:
@@ -278,6 +278,7 @@ def thermald_thread(end_event, hw_queue):
|
||||
startup_conditions["up_to_date"] = params.get("Offroad_ConnectivityNeeded") is None or params.get_bool("DisableUpdates") or params.get_bool("SnoozeUpdate")
|
||||
startup_conditions["not_uninstalling"] = not params.get_bool("DoUninstall")
|
||||
startup_conditions["accepted_terms"] = params.get("HasAcceptedTerms") == terms_version
|
||||
startup_conditions["offroad_min_time"] = (not started_seen) or ((off_ts is not None) and (sec_since_boot() - off_ts) > 5.)
|
||||
|
||||
# with 2% left, we killall, otherwise the phone will take a long time to boot
|
||||
startup_conditions["free_space"] = msg.deviceState.freeSpacePercent > 2
|
||||
@@ -338,7 +339,8 @@ def thermald_thread(end_event, hw_queue):
|
||||
started_seen = True
|
||||
else:
|
||||
if onroad_conditions["ignition"] and (startup_conditions != startup_conditions_prev):
|
||||
cloudlog.event("Startup blocked", startup_conditions=startup_conditions, onroad_conditions=onroad_conditions)
|
||||
cloudlog.event("Startup blocked", startup_conditions=startup_conditions, onroad_conditions=onroad_conditions, error=True)
|
||||
startup_conditions_prev = startup_conditions.copy()
|
||||
|
||||
started_ts = None
|
||||
if off_ts is None:
|
||||
@@ -372,7 +374,6 @@ def thermald_thread(end_event, hw_queue):
|
||||
pm.send("deviceState", msg)
|
||||
|
||||
should_start_prev = should_start
|
||||
startup_conditions_prev = startup_conditions.copy()
|
||||
|
||||
# Log to statsd
|
||||
statlog.gauge("free_space_percent", msg.deviceState.freeSpacePercent)
|
||||
|
||||
Reference in New Issue
Block a user