vacuum db after migration
This commit is contained in:
parent
73f8349a00
commit
083ff401d5
1 changed files with 6 additions and 0 deletions
|
|
@ -1,5 +1,6 @@
|
|||
import json
|
||||
import logging
|
||||
from datetime import timedelta
|
||||
|
||||
from haiku.rag.store.engine import Store
|
||||
from haiku.rag.store.upgrades import Upgrade
|
||||
|
|
@ -95,6 +96,11 @@ async def _apply_canonical_metadata_keys(store: Store) -> None:
|
|||
total,
|
||||
)
|
||||
|
||||
if rewritten:
|
||||
# Compact the documents table to reclaim space from the rewritten rows.
|
||||
logger.info("Compacting documents table to reclaim %d row rewrites", rewritten)
|
||||
await store.documents_table.optimize(cleanup_older_than=timedelta(seconds=0))
|
||||
|
||||
|
||||
upgrade_canonical_metadata_keys = Upgrade(
|
||||
version="0.50.0",
|
||||
|
|
|
|||
Loading…
Reference in a new issue