refactor: Add boolean configuration helper and streamline host tag retrieval

This commit is contained in:
Nils Andreas Svee committed 2026-04-22 16:55:05 +07:00
1 parent 45da0c030e
commit 7d5c2f0275
1 file changed
+4 -6
+4 -6
View File
@@ -352,13 +352,11 @@ impl Config {
} }
} }
fn get_host_tag() -> String { fn get_bool(env_key: &str, uci_key: &str, default: Option<bool>) -> Result<bool, ConfigError> {
if let Ok(val) = env::var("SQMA_OBSERVABILITY_HOST_TAG") { Self::get::<FlexiBool>(env_key, uci_key, default.map(FlexiBool)).map(|f| f.0)
if !val.is_empty() { }
return val;
}
}
fn get_host_tag() -> String {
// rustix can give us the hostname without shelling out // rustix can give us the hostname without shelling out
rustix::system::uname() rustix::system::uname()
.nodename() .nodename()