refactor(state): return FTS index count from vacuum()

Have vacuum() return optimize_fts()'s count so the CLI 'sessions optimize'
summary uses the real merged-index count instead of probing the private
_FTS_TABLES / _fts_table_exists() members.
This commit is contained in:
teknium1
2026-05-29 05:09:56 -07:00
committed by Teknium
parent 38695254f8
commit 904c0b479b
2 changed files with 10 additions and 10 deletions
+3 -8
View File
@@ -13576,14 +13576,9 @@ Examples:
)
print("Optimizing session store (FTS merge + VACUUM)…")
try:
# vacuum() merges FTS5 segments (optimize_fts) then VACUUMs.
# Probe the index count first for the summary line.
n = sum(
1
for t in db._FTS_TABLES
if db._fts_table_exists(t)
)
db.vacuum()
# vacuum() merges FTS5 segments (optimize_fts) then VACUUMs,
# and returns the number of indexes it merged.
n = db.vacuum()
except Exception as e:
print(f"Error: optimization failed: {e}")
db.close()