mirror of
https://github.com/lllin000/PaperForge.git
synced 2026-07-22 06:50:53 +00:00
feat(23-03): add incremental index refresh to deep-reading status sync
- Import refresh_index_entry from asset_index module - After status sync report, refresh canonical index for every paper - Refresh even when synced==0 (formal note content may have changed) - Failure to refresh logs warning, does not abort the worker
This commit is contained in:
parent
c412f82390
commit
0f2b957cc6
1 changed files with 10 additions and 0 deletions
|
|
@ -13,6 +13,7 @@ from paperforge.worker._utils import (
|
|||
write_json,
|
||||
yaml_quote,
|
||||
)
|
||||
from paperforge.worker.asset_index import refresh_index_entry
|
||||
from paperforge.worker.base_views import ensure_base_views
|
||||
from paperforge.worker.sync import has_deep_reading_content
|
||||
|
||||
|
|
@ -135,4 +136,13 @@ def run_deep_reading(vault: Path, verbose: bool = False) -> int:
|
|||
report_path = paths["pipeline"] / "deep-reading-queue.md"
|
||||
report_path.write_text("\n".join(report_lines), encoding="utf-8")
|
||||
print(f"deep-reading: synced {synced} records, {len(pending_queue)} pending")
|
||||
|
||||
# Refresh canonical index for each paper (even if synced==0, formal note content may have changed)
|
||||
for record in records:
|
||||
key = record["zotero_key"]
|
||||
if key:
|
||||
try:
|
||||
refresh_index_entry(vault, key)
|
||||
except Exception:
|
||||
logger.warning("Failed to refresh index entry for %s", key)
|
||||
return 0
|
||||
|
|
|
|||
Loading…
Reference in a new issue