fix(fabric): use broadcast subject for NATS capabilities discovery
NATS wildcards (node.*.capabilities.get) only work for subscriptions, not for publish. Switch to a dedicated broadcast subject (fabric.capabilities.discover) that all NCS instances subscribe to, enabling proper scatter-gather discovery across nodes. Made-with: Cursor
This commit is contained in:
@@ -310,15 +310,29 @@ class VectorStore:
|
||||
|
||||
async def get_collection_stats(self) -> Dict[str, Any]:
|
||||
"""Get collection statistics"""
|
||||
memories_info = self.client.get_collection(self.memories_collection)
|
||||
|
||||
return {
|
||||
"memories": {
|
||||
"points_count": memories_info.points_count,
|
||||
"vectors_count": memories_info.vectors_count,
|
||||
"indexed_vectors_count": memories_info.indexed_vectors_count
|
||||
try:
|
||||
memories_info = self.client.get_collection(self.memories_collection)
|
||||
|
||||
points_count = getattr(memories_info, 'points_count', 0)
|
||||
vectors_count = getattr(memories_info, 'vectors_count', points_count)
|
||||
indexed_vectors_count = getattr(memories_info, 'indexed_vectors_count', 0)
|
||||
|
||||
return {
|
||||
"memories": {
|
||||
"points_count": points_count,
|
||||
"vectors_count": vectors_count,
|
||||
"indexed_vectors_count": indexed_vectors_count
|
||||
}
|
||||
}
|
||||
except Exception as e:
|
||||
logger.error("get_collection_stats_failed", error=str(e))
|
||||
return {
|
||||
"memories": {
|
||||
"points_count": 0,
|
||||
"vectors_count": 0,
|
||||
"indexed_vectors_count": 0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# Global instance
|
||||
|
||||
Reference in New Issue
Block a user