fix: Clean up both ChromaDB files and temp directories in reset

Co-Authored-By: Joe Moura <joao@crewai.com>
This commit is contained in:
Devin AI
2025-02-09 23:28:47 +00:00
parent 0dfa5b05d3
commit 08b541cc75

View File

@@ -153,9 +153,13 @@ class RAGStorage(BaseRAGStorage):
try:
if self.app:
self.app.reset()
# Clean up ChromaDB files
storage_path = os.path.join(db_storage_path(), self.type)
if os.path.exists(storage_path):
shutil.rmtree(storage_path)
# Clean up temporary directory
if os.path.exists(self.path):
shutil.rmtree(self.path)
self.app = None
self.collection = None
except Exception as e: