fix: ServiceStatusData deserialization mismatch with agent response
Some checks failed
CI Pipeline / Rust Format Check (push) Failing after 4s
CI Pipeline / Clippy Lints (push) Successful in 45s
CI Pipeline / Rust Unit Tests (push) Successful in 1m2s
CI Pipeline / Security Audit (push) Successful in 5s
CI Pipeline / Frontend Lint & Type Check (push) Failing after 9s
CI Pipeline / Build .deb & Release (push) Has been skipped
Some checks failed
CI Pipeline / Rust Format Check (push) Failing after 4s
CI Pipeline / Clippy Lints (push) Successful in 45s
CI Pipeline / Rust Unit Tests (push) Successful in 1m2s
CI Pipeline / Security Audit (push) Successful in 5s
CI Pipeline / Frontend Lint & Type Check (push) Failing after 9s
CI Pipeline / Build .deb & Release (push) Has been skipped
Manager expected fields: name, status, healthy, uptime_secs Agent actually returns: name, display_name, active_state, sub_state, load_state, enabled_state, main_pid, healthy Updated ServiceStatusData to match agent response format. Updated health_check_poller.rs to use new field names.
This commit is contained in:
@ -202,12 +202,20 @@ pub struct AgentJobStatus {
|
||||
pub struct ServiceStatusData {
|
||||
/// Service name.
|
||||
pub name: String,
|
||||
/// Service status string (e.g. `"running"`, `"stopped"`, `"failed"`).
|
||||
pub status: String,
|
||||
/// Human-readable service name.
|
||||
pub display_name: String,
|
||||
/// Active state (e.g. `"active"`, `"inactive"`, `"failed"`).
|
||||
pub active_state: String,
|
||||
/// Sub state (e.g. `"running"`, `"dead"`, `"exited"`).
|
||||
pub sub_state: String,
|
||||
/// Load state (e.g. `"loaded"`, `"not-found"`).
|
||||
pub load_state: String,
|
||||
/// Enabled state (e.g. `"enabled"`, `"disabled"`).
|
||||
pub enabled_state: String,
|
||||
/// Main PID of the service process.
|
||||
pub main_pid: Option<u32>,
|
||||
/// Whether the service is considered healthy.
|
||||
pub healthy: bool,
|
||||
/// Seconds elapsed since the service started (`null` if not running).
|
||||
pub uptime_secs: Option<u64>,
|
||||
}
|
||||
|
||||
// ============================================================
|
||||
|
||||
@ -262,15 +262,18 @@ async fn run_service_check(
|
||||
Ok(data) => {
|
||||
let detail = if data.healthy {
|
||||
format!(
|
||||
"Service '{}' is {} (uptime: {}s)",
|
||||
"Service '{}' is {}/{} (enabled: {})",
|
||||
data.name,
|
||||
data.status,
|
||||
data.uptime_secs.map_or("N/A".to_string(), |s| s.to_string())
|
||||
data.active_state,
|
||||
data.sub_state,
|
||||
data.enabled_state
|
||||
)
|
||||
} else {
|
||||
format!(
|
||||
"Service '{}' status: {} (unhealthy)",
|
||||
data.name, data.status
|
||||
"Service '{}' status: {}/{} (unhealthy, enabled: {})",
|
||||
data.name, data.active_state,
|
||||
data.sub_state,
|
||||
data.enabled_state
|
||||
)
|
||||
};
|
||||
(data.healthy, detail)
|
||||
|
||||
Reference in New Issue
Block a user