KajetanNiewczas commited on
Commit ·
d458e3c
1
Parent(s): 7f86dca
Fix database cleaning issue
Browse files
src/database/db_manipulation.py
CHANGED
|
@@ -107,10 +107,8 @@ def clean_db(session_id: str) -> None:
|
|
| 107 |
Args:
|
| 108 |
session_id (str): Unique identifier for the current session.
|
| 109 |
"""
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
)
|
| 113 |
-
if db:
|
| 114 |
chroma_client.delete_collection(name=session_id)
|
| 115 |
LOGGER.info("🗑️ Cleaning database for session ID: %s", session_id)
|
| 116 |
else:
|
|
|
|
| 107 |
Args:
|
| 108 |
session_id (str): Unique identifier for the current session.
|
| 109 |
"""
|
| 110 |
+
collections = chroma_client.list_collections()
|
| 111 |
+
if any(col.name == session_id for col in collections):
|
|
|
|
|
|
|
| 112 |
chroma_client.delete_collection(name=session_id)
|
| 113 |
LOGGER.info("🗑️ Cleaning database for session ID: %s", session_id)
|
| 114 |
else:
|