mirror of https://github.com/commaai/openpilot.git
update network type less frequently (#1108)
old-commit-hash: 2cc0eb1ca0
This commit is contained in:
parent
c21e717118
commit
313d8637f9
|
@ -192,10 +192,12 @@ def thermald_thread():
|
||||||
if health is not None:
|
if health is not None:
|
||||||
usb_power = health.health.usbPowerMode != log.HealthData.UsbPowerMode.client
|
usb_power = health.health.usbPowerMode != log.HealthData.UsbPowerMode.client
|
||||||
|
|
||||||
try:
|
# get_network_type is an expensive call. update every 3s
|
||||||
network_type = get_network_type()
|
if (count % int(3. / DT_TRML)) == 0:
|
||||||
except subprocess.CalledProcessError:
|
try:
|
||||||
pass
|
network_type = get_network_type()
|
||||||
|
except subprocess.CalledProcessError:
|
||||||
|
pass
|
||||||
|
|
||||||
msg.thermal.freeSpace = get_available_percent(default=100.0) / 100.0
|
msg.thermal.freeSpace = get_available_percent(default=100.0) / 100.0
|
||||||
msg.thermal.memUsedPercent = int(round(psutil.virtual_memory().percent))
|
msg.thermal.memUsedPercent = int(round(psutil.virtual_memory().percent))
|
||||||
|
|
Loading…
Reference in New Issue