From e64527ce2f513519bb8953273d2f6f1f8b08ac32 Mon Sep 17 00:00:00 2001 From: Christoffer Martinsson Date: Tue, 14 Oct 2025 20:30:47 +0200 Subject: [PATCH] Fix compilation error in nginx site status handling --- agent/src/collectors/service.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/agent/src/collectors/service.rs b/agent/src/collectors/service.rs index ae4758a..d816272 100644 --- a/agent/src/collectors/service.rs +++ b/agent/src/collectors/service.rs @@ -1360,10 +1360,17 @@ impl Collector for ServiceCollector { // Determine status and description based on latency measurement let (site_status, site_description) = match latency { - Some(ms) => (ServiceStatus::Running, None), + Some(_ms) => (ServiceStatus::Running, None), None => (ServiceStatus::Stopped, Some(vec!["unreachable".to_string()])), }; + // Update counters based on site status + match site_status { + ServiceStatus::Running => healthy += 1, + ServiceStatus::Stopped => failed += 1, + _ => degraded += 1, + } + services.push(ServiceData { name: site.clone(), status: site_status, @@ -1379,13 +1386,6 @@ impl Collector for ServiceCollector { sub_service: Some("nginx".to_string()), latency_ms: latency, }); - - // Update counters based on site status - match site_status { - ServiceStatus::Running => healthy += 1, - ServiceStatus::Stopped => failed += 1, - _ => degraded += 1, - } } } }