pull/32736/head
Shane Smiskol 11 months ago
parent 573e2d4c0c
commit 7334a69371
  1. 4
      system/athena/athenad.py
  2. 8
      system/loggerd/uploader.py

@ -105,7 +105,7 @@ cur_upload_items: dict[int, UploadItem | None] = {}
def strip_zstd_extension(fn: str) -> str:
if fn.endswith('.zstd'):
if fn.endswith('.zst'):
return fn[:-4]
return fn
@ -284,7 +284,7 @@ def _do_upload(upload_item: UploadItem, callback: Callable = None) -> requests.R
path = upload_item.path
compress = False
# If file does not exist, but does exist without the .zstd extension we will compress on the fly
# If file does not exist, but does exist without the .zst extension we will compress on the fly
if not os.path.exists(path) and os.path.exists(strip_zstd_extension(path)):
path = strip_zstd_extension(path)
compress = True

@ -84,7 +84,7 @@ class Uploader:
self.last_filename = ""
self.immediate_folders = ["crash/", "boot/"]
self.immediate_priority = {"qlog": 0, "qlog.zstd": 0, "qcamera.ts": 1}
self.immediate_priority = {"qlog": 0, "qlog.zst": 0, "qcamera.ts": 1}
def list_upload_files(self, metered: bool) -> Iterator[tuple[str, str, str]]:
r = self.params.get("AthenadRecentlyViewedRoutes", encoding="utf8")
@ -153,7 +153,7 @@ class Uploader:
with open(fn, "rb") as f:
data: BinaryIO
if key.endswith('.zstd') and not fn.endswith('.zstd'):
if key.endswith('.zst') and not fn.endswith('.zst'):
compressed = zstd.compress(f.read(), LOG_COMPRESSION_LEVEL)
data = io.BytesIO(compressed)
else:
@ -219,8 +219,8 @@ class Uploader:
name, key, fn = d
# qlogs and bootlogs need to be compressed before uploading
if key.endswith(('qlog', 'rlog')) or (key.startswith('boot/') and not key.endswith('.zstd')):
key += ".zstd"
if key.endswith(('qlog', 'rlog')) or (key.startswith('boot/') and not key.endswith('.zst')):
key += ".zst"
return self.upload(name, key, fn, network_type, metered)

Loading…
Cancel
Save