fix: clear stale health notifications

This commit is contained in:
Dorian
2026-05-14 08:57:54 -04:00
parent f95e9a1cd0
commit b8053c00ca
3 changed files with 38 additions and 5 deletions
+9 -2
View File
@@ -298,7 +298,11 @@ fn shell_join(parts: &[String]) -> String {
fn quote_environment(env: &str) -> String {
let env = env.replace(['\r', '\n'], " ");
if env.is_empty() || env.chars().any(|c| c.is_whitespace() || "\"\\$`".contains(c)) {
if env.is_empty()
|| env
.chars()
.any(|c| c.is_whitespace() || "\"\\$`".contains(c))
{
let escaped = env
.replace('\\', "\\\\")
.replace('"', "\\\"")
@@ -793,7 +797,10 @@ mod tests {
#[test]
fn quote_environment_quotes_values_with_spaces() {
assert_eq!(quote_environment("BITCOIN_RPC_PASS=secret"), "BITCOIN_RPC_PASS=secret");
assert_eq!(
quote_environment("BITCOIN_RPC_PASS=secret"),
"BITCOIN_RPC_PASS=secret"
);
assert_eq!(
quote_environment("RELAY_NAME=Archipelago Nostr Relay"),
"\"RELAY_NAME=Archipelago Nostr Relay\""