mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-08-21 00:03:45 +08:00
process replay: use zst (#33138)
* test * update refs to zst * update old-commit-hash: dfd387520e88fa68f0485b6ce8dcf5befa82bafa
This commit is contained in:
@@ -30,8 +30,10 @@ RawLogIterable = Iterable[bytes]
|
||||
def save_log(dest, log_msgs, compress=True):
|
||||
dat = b"".join(msg.as_builder().to_bytes() for msg in log_msgs)
|
||||
|
||||
if compress:
|
||||
if compress and dest.endswith(".bz2"):
|
||||
dat = bz2.compress(dat)
|
||||
elif compress and dest.endswith(".zst"):
|
||||
dat = zstd.compress(dat, 10)
|
||||
|
||||
with open(dest, "wb") as f:
|
||||
f.write(dat)
|
||||
|
||||
Reference in New Issue
Block a user