Give each help file unique sequential extraction codes, show the count, and allow wiping all extractions for a file while testing.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -102,8 +102,11 @@ def _run_rescan(job_id: str, staging: Path, prefix: str, force: bool):
|
||||
# Import here so webapp boots even if processor deps fail later
|
||||
from help_processor import process_directory
|
||||
|
||||
process_directory(
|
||||
input_dir=staging,
|
||||
input_dir = staging / "input"
|
||||
if not input_dir.is_dir():
|
||||
input_dir = staging
|
||||
summary = process_directory(
|
||||
input_dir=input_dir,
|
||||
output_dir=out,
|
||||
conn_str=cfg["conn"],
|
||||
api_key=cfg["api_key"],
|
||||
@@ -112,12 +115,20 @@ def _run_rescan(job_id: str, staging: Path, prefix: str, force: bool):
|
||||
purge_missing=False,
|
||||
remote_root=cfg["remote_root"],
|
||||
)
|
||||
files = []
|
||||
if isinstance(summary, dict):
|
||||
files = summary.get("files") or []
|
||||
sections = summary.get("sections")
|
||||
else:
|
||||
sections = summary
|
||||
_set_job(
|
||||
job_id,
|
||||
status="done",
|
||||
message="ok",
|
||||
output_dir=str(out),
|
||||
prefix=prefix,
|
||||
files=files,
|
||||
sections=sections,
|
||||
)
|
||||
except Exception as e:
|
||||
_set_job(job_id, status="error", message=str(e))
|
||||
|
||||
Reference in New Issue
Block a user