mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-09-30 04:03:44 +08:00
sync: fix model switching
This commit is contained in:
@@ -27,9 +27,10 @@ _LAST_VALIDATED_RAW = None
|
||||
|
||||
|
||||
def _compute_hash(file_path: str) -> str | None:
|
||||
from openpilot.common.file_chunker import read_file_chunked
|
||||
from openpilot.common.file_chunker import open_file_chunked
|
||||
try:
|
||||
return hashlib.sha256(read_file_chunked(file_path)).hexdigest().lower()
|
||||
with open_file_chunked(file_path) as file:
|
||||
return hashlib.file_digest(file, "sha256").hexdigest().lower()
|
||||
except FileNotFoundError:
|
||||
return None
|
||||
|
||||
|
||||
Reference in New Issue
Block a user