car_helpers: add variable to disable FW cache (#28626)

* Update car_helpers.py

* actually caches the fw

* simpler
old-commit-hash: 4bec6b7ab77d19e459c5793f0f2d610bb966bc37
This commit is contained in:
Shane Smiskol
2023-06-22 01:20:40 -07:00
committed by GitHub
parent ea8f8d2265
commit 17a3653e4b

View File

@@ -79,6 +79,7 @@ interfaces = load_interfaces(interface_names)
def fingerprint(logcan, sendcan, num_pandas):
fixed_fingerprint = os.environ.get('FINGERPRINT', "")
skip_fw_query = os.environ.get('SKIP_FW_QUERY', False)
disable_fw_cache = os.environ.get('DISABLE_FW_CACHE', False)
ecu_rx_addrs = set()
params = Params()
@@ -92,7 +93,8 @@ def fingerprint(logcan, sendcan, num_pandas):
if cached_params.carName == "mock":
cached_params = None
if cached_params is not None and len(cached_params.carFw) > 0 and cached_params.carVin is not VIN_UNKNOWN:
if cached_params is not None and len(cached_params.carFw) > 0 and \
cached_params.carVin is not VIN_UNKNOWN and not disable_fw_cache:
cloudlog.warning("Using cached CarParams")
vin, vin_rx_addr = cached_params.carVin, 0
car_fw = list(cached_params.carFw)