hack: Allow reading Zstd compression level from env
ci/woodpecker/push/build Pipeline failed Details
ci/woodpecker/push/release Pipeline was successful Details

Signed-off-by: Olivier <olivier@librepush.net>
This commit is contained in:
Olivier 'reivilibre' 2024-06-27 22:36:29 +01:00
parent f17ad6fac3
commit 0869aa1afb
1 changed files with 11 additions and 2 deletions

View File

@ -14,7 +14,7 @@ use std::pin::Pin;
use std::sync::Arc;
use std::thread::JoinHandle;
use tokio::runtime::Handle;
use tracing::{debug, error, info_span, warn};
use tracing::{debug, error, info, info_span, warn};
use yama_localcache::StoreConnection;
use yama_midlevel_crypto::chunk_id::{ChunkId, ChunkIdKey};
use yama_pile::bloblogs::BloblogWriter;
@ -365,7 +365,16 @@ fn storage_pipeline_worker_blocking<JobName: Debug>(
}
fn get_zstd_level() -> i32 {
// TODO Read from env?
// TODO Do something more proper
if let Ok(var) = std::env::var("YAMA_HACK_ZSTD_LEVEL") {
if let Ok(level) = var.parse() {
info!("YAMA_HACK_ZSTD_LEVEL: using {level}");
return level;
} else {
error!("YAMA_HACK_ZSTD_LEVEL was not set to a valid i32: {var:?}")
}
}
return 16;
}