Check table_names() before dropping chunks in recreate_embeddings_table
This commit is contained in:
parent
729899299b
commit
b23bad32c3
1 changed files with 5 additions and 4 deletions
|
|
@ -586,11 +586,12 @@ class Store:
|
|||
ReadOnlyError: If the store is in read-only mode.
|
||||
"""
|
||||
self._assert_writable()
|
||||
# Drop and recreate chunks table
|
||||
try:
|
||||
# Drop and recreate chunks table. Check existence first rather than
|
||||
# catching-and-swallowing drop_table's errors — a catch-all would
|
||||
# hide real failures (permissions, storage-backend errors) and then
|
||||
# the subsequent create_table would fail confusingly.
|
||||
if "chunks" in await self.db.table_names():
|
||||
await self.db.drop_table("chunks")
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
# Update the ChunkRecord model with new vector dimension
|
||||
self.ChunkRecord = create_chunk_model(self.embedder._vector_dim)
|
||||
|
|
|
|||
Loading…
Reference in a new issue