fix: Face processor now saves status and total_faces to face.json
This commit is contained in:
@@ -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}"
|
||||
|
||||
Reference in New Issue
Block a user