mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-11 00:58:30 +00:00
fix: Clean up both ChromaDB files and temp directories in reset
Co-Authored-By: Joe Moura <joao@crewai.com>
This commit is contained in:
@@ -153,9 +153,13 @@ class RAGStorage(BaseRAGStorage):
|
|||||||
try:
|
try:
|
||||||
if self.app:
|
if self.app:
|
||||||
self.app.reset()
|
self.app.reset()
|
||||||
|
# Clean up ChromaDB files
|
||||||
storage_path = os.path.join(db_storage_path(), self.type)
|
storage_path = os.path.join(db_storage_path(), self.type)
|
||||||
if os.path.exists(storage_path):
|
if os.path.exists(storage_path):
|
||||||
shutil.rmtree(storage_path)
|
shutil.rmtree(storage_path)
|
||||||
|
# Clean up temporary directory
|
||||||
|
if os.path.exists(self.path):
|
||||||
|
shutil.rmtree(self.path)
|
||||||
self.app = None
|
self.app = None
|
||||||
self.collection = None
|
self.collection = None
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|||||||
Reference in New Issue
Block a user