fix: Face processor now saves status and total_faces to face.json

This commit is contained in:
Accusys
2026-09-26 23:06:11 +08:00
parent 8a736a4103
commit 357e585399
99 changed files with 13881 additions and 1065 deletions
+25
View File
@@ -45,8 +45,33 @@ def run_sql(sql: str) -> str:
return r.stdout.strip()
def already_packed(file_uuid: str, phase: int) -> bool:
"""Return True if a prior phase package already exists for this file_uuid
(RELEASE_INFO.txt records the File UUID). Prevents re-packing on every
job reprocess cycle, which filled the disk with duplicated timestamp dirs."""
phase_dir = RELEASE_DIR / f"phase{phase}"
if not phase_dir.is_dir():
return False
for pkg in phase_dir.iterdir():
if not pkg.is_dir():
continue
info = pkg / "RELEASE_INFO.txt"
if not info.is_file():
continue
try:
content = info.read_text(errors="ignore")
except OSError:
continue
if f"File UUID: {file_uuid}" in content and f"Phase: {phase}" in content:
return True
return False
def pack_phase(file_uuid: str, phase: int) -> Path:
"""Package deliverables for phase 1 or 2."""
if already_packed(file_uuid, phase):
print(f"[RELEASE] Phase {phase} already packaged for {file_uuid}, skipping")
return RELEASE_DIR / f"phase{phase}" / "latest"
phase_dir = RELEASE_DIR / f"phase{phase}"
stamp = ts()
pkg_dir = phase_dir / f"{VERSION}_{stamp}"