feat: Health command — version, pid, started_at (proto + daemon)

This commit is contained in:
2026-06-10 12:01:54 +07:00
parent f18d929c10
commit f7763a84fc
2 changed files with 46 additions and 1 deletions
+10
View File
@@ -122,6 +122,7 @@ pub enum Cmd {
limit: Option<u32>,
},
MarkRead { target: MarkReadTarget },
Health,
Status,
Shutdown,
}
@@ -321,6 +322,15 @@ mod tests {
assert_eq!(back, evt);
}
#[test]
fn health_cmd_round_trips() {
let env = Envelope::Req { id: 1, cmd: Cmd::Health };
let j = serde_json::to_string(&env).unwrap();
assert!(j.contains(r#""cmd":"health""#));
let back: Envelope = serde_json::from_str(&j).unwrap();
assert_eq!(back, env);
}
#[test]
fn event_log_cmd_no_limit_round_trips() {
let env = Envelope::Req { id: 9, cmd: Cmd::EventLog { limit: None } };