Fix vector deletion logging to show actual deleted count

This commit is contained in:
yangdx 2025-10-27 14:22:16 +08:00
parent 94f24a66f2
commit 411e92e6b9

View file

@ -184,9 +184,17 @@ class NanoVectorDBStorage(BaseVectorStorage):
"""
try:
client = await self._get_client()
# Record count before deletion
before_count = len(client)
client.delete(ids)
# Calculate actual deleted count
after_count = len(client)
deleted_count = before_count - after_count
logger.debug(
f"[{self.workspace}] Successfully deleted {len(ids)} vectors from {self.namespace}"
f"[{self.workspace}] Successfully deleted {deleted_count} vectors from {self.namespace}"
)
except Exception as e:
logger.error(