Config hot reloading API

This commit is contained in:
mdecimus
2024-03-28 17:21:32 +01:00
parent 16b0465933
commit cb4d2f15ae
64 changed files with 1118 additions and 846 deletions

View File

@@ -166,19 +166,12 @@ impl CompressionAlgo {
}
impl ParseValue for CompressionAlgo {
fn parse_value(
key: impl utils::config::utils::AsKey,
value: &str,
) -> utils::config::Result<Self> {
fn parse_value(value: &str) -> utils::config::Result<Self> {
match value {
"lz4" => Ok(CompressionAlgo::Lz4),
//"zstd" => Ok(CompressionAlgo::Zstd),
"none" | "false" | "disable" | "disabled" => Ok(CompressionAlgo::None),
algo => Err(format!(
"Invalid compression algorithm: {} for key {}",
algo,
key.as_key()
)),
algo => Err(format!("Invalid compression algorithm: {algo}",)),
}
}
}