Auto-vacuum when inserting/updating
This commit is contained in:
parent
c6eaf9d5cd
commit
ce11efd17c
2 changed files with 4 additions and 1 deletions
|
|
@ -61,7 +61,6 @@ async def populate_db(spec: DatasetSpec) -> None:
|
|||
metadata=payload.metadata,
|
||||
)
|
||||
progress.advance(task)
|
||||
rag.store.vacuum()
|
||||
|
||||
|
||||
def _is_relevant_match(retrieved_uri: str | None, sample: RetrievalSample) -> bool:
|
||||
|
|
|
|||
|
|
@ -200,6 +200,8 @@ class DocumentRepository:
|
|||
chunk.order = order
|
||||
await self.chunk_repository.create(chunk)
|
||||
|
||||
# Vacuum old versions after successful creation
|
||||
self.store.vacuum()
|
||||
return created_doc
|
||||
except Exception:
|
||||
# Roll back to the captured versions and re-raise
|
||||
|
|
@ -230,6 +232,8 @@ class DocumentRepository:
|
|||
updated_doc.id, docling_document
|
||||
)
|
||||
|
||||
# Vacuum old versions after successful update
|
||||
self.store.vacuum()
|
||||
return updated_doc
|
||||
except Exception:
|
||||
# Roll back to the captured versions and re-raise
|
||||
|
|
|
|||
Loading…
Reference in a new issue