mirror of
https://github.com/lllin000/PaperForge.git
synced 2026-07-22 06:50:53 +00:00
feat(memory): show (fast) in sync output when hash matches
This commit is contained in:
parent
48b564594c
commit
8fd1018cf2
2 changed files with 3 additions and 1 deletions
|
|
@ -83,7 +83,8 @@ def run(args: argparse.Namespace) -> int:
|
|||
try:
|
||||
from paperforge.memory.builder import build_from_index
|
||||
counts = build_from_index(vault)
|
||||
print(f"memory: {counts.get('papers_indexed', 0)} papers indexed")
|
||||
tag = " (fast)" if counts.get("hash_match") else ""
|
||||
print(f"memory: {counts.get('papers_indexed', 0)} papers{tag}")
|
||||
except Exception as e:
|
||||
print(f"memory: deferred ({e})")
|
||||
|
||||
|
|
|
|||
|
|
@ -155,6 +155,7 @@ def build_from_index(vault: Path) -> dict:
|
|||
if cached and cached[0] == canonical_hash and stored_version == CURRENT_SCHEMA_VERSION:
|
||||
papers_count = conn.execute("SELECT COUNT(*) FROM papers").fetchone()[0]
|
||||
conn.close()
|
||||
logger.info("Index unchanged, skipping memory rebuild (%s papers)", papers_count)
|
||||
return {
|
||||
"papers_indexed": papers_count,
|
||||
"db_path": str(db_path),
|
||||
|
|
|
|||
Loading…
Reference in a new issue