Skip to content
This repository has been archived by the owner on Oct 18, 2023. It is now read-only.

Commit

Permalink
bottomless: use default compression level for xz
Browse files Browse the repository at this point in the history
Best level seems to produce corrupted files.
  • Loading branch information
psarna committed Oct 17, 2023
1 parent 7512319 commit 1fa6774
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
5 changes: 1 addition & 4 deletions bottomless/src/backup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,7 @@ impl WalCopier {
gzip.shutdown().await?;
}
CompressionKind::Xz => {
let mut xz = async_compression::tokio::write::XzEncoder::with_quality(
&mut out,
async_compression::Level::Best,
);
let mut xz = async_compression::tokio::write::XzEncoder::new(&mut out);
wal.copy_frames(&mut xz, len).await?;
xz.shutdown().await?;
}
Expand Down
3 changes: 1 addition & 2 deletions bottomless/src/replicator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -681,8 +681,7 @@ impl Replicator {
.truncate(true)
.open(&xz_path)
.await?;
let mut writer =
XzEncoder::with_quality(compressed_file, async_compression::Level::Best);
let mut writer = XzEncoder::new(compressed_file);
let size = tokio::io::copy(&mut reader, &mut writer).await?;
writer.shutdown().await?;
tracing::debug!(
Expand Down

0 comments on commit 1fa6774

Please sign in to comment.