raylib ui: fix Firehose param caching (#35549)

* oof

* fixx
pull/35546/head^2
Shane Smiskol 1 week ago committed by GitHub
parent 2a1939f37a
commit 62b301ae76
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 8
      selfdrive/ui/layouts/settings/firehose.py

@ -51,11 +51,9 @@ class FirehoseLayout(Widget):
def _get_segment_count(self) -> int:
stats = self.params.get(self.PARAM_KEY, encoding='utf8')
if not stats:
return 0
try:
return int(json.loads(stats).get("firehose", 0))
except (json.JSONDecodeError, TypeError, ValueError):
except Exception:
cloudlog.exception(f"Failed to decode firehose stats: {stats}")
return 0
@ -166,9 +164,9 @@ class FirehoseLayout(Widget):
if response.status_code == 200:
data = response.json()
self.segment_count = data.get("firehose", 0)
self.params.put(self.PARAM_KEY, str(self.segment_count))
self.params.put(self.PARAM_KEY, json.dumps(data))
except Exception as e:
cloudlog.debug(f"Failed to fetch firehose stats: {e}")
cloudlog.error(f"Failed to fetch firehose stats: {e}")
def _update_loop(self):
while self.running:

Loading…
Cancel
Save