hack: Allow reading Zstd compression level from env
Signed-off-by: Olivier <olivier@librepush.net>
This commit is contained in:
parent
f17ad6fac3
commit
0869aa1afb
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue