This commit is contained in:
2025-10-12 17:29:29 +02:00
parent 088c42e55a
commit 49aee702f2
2 changed files with 28 additions and 25 deletions

View File

@@ -35,7 +35,6 @@ struct HostRuntimeState {
smart: Option<SmartMetrics>,
services: Option<ServiceMetrics>,
backup: Option<BackupMetrics>,
service_description_cache: HashMap<String, Vec<String>>, // service_name -> last_known_descriptions
}
/// Top-level application state container.
@@ -262,22 +261,7 @@ impl App {
}
let mut snapshot = service_metrics.clone();
// Update description cache and fill in missing descriptions
for service in &mut snapshot.services {
// If service has a new description, cache it
if let Some(ref description) = service.description {
if !description.is_empty() {
state.service_description_cache.insert(service.name.clone(), description.clone());
}
}
// If service has no description but we have a cached one, use it
if service.description.is_none() || service.description.as_ref().map_or(true, |d| d.is_empty()) {
if let Some(cached_description) = state.service_description_cache.get(&service.name) {
service.description = Some(cached_description.clone());
}
}
}
// No more need for dashboard-side description caching since agent handles it
self.history.record_services(service_metrics);
state.services = Some(snapshot);