feat: harden demo flows and observability
This commit is contained in:
@@ -6,6 +6,7 @@ use std::{
|
||||
|
||||
use mcpaas_registry::{PostgresRegistry, RegistryError, RegistryOperation};
|
||||
use tokio::sync::RwLock;
|
||||
use tracing::info;
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct PublishedToolCatalog {
|
||||
@@ -66,11 +67,18 @@ impl PublishedToolCatalog {
|
||||
.map(|operation| (operation.name.clone(), operation))
|
||||
.collect::<HashMap<_, _>>();
|
||||
let mut guard = self.cached.write().await;
|
||||
let previous_count = guard.tools.len();
|
||||
|
||||
guard.loaded_at = Some(Instant::now());
|
||||
guard.tools = tools;
|
||||
guard.tools_by_name = tools_by_name;
|
||||
|
||||
info!(
|
||||
published_tool_count = guard.tools.len(),
|
||||
previous_published_tool_count = previous_count,
|
||||
"published tool catalog refreshed"
|
||||
);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user