fix: remove progress task on skipped jobs (v0.5.12)

progress.add_task() fires unconditionally at the top of the job loop;
both continue paths (ValueError from _safe_person_dir and the symlink
TOCTOU guard) skipped remove_task(), leaving orphaned 0% rows in the
terminal for the rest of the run.
This commit is contained in:
2026-06-15 01:05:49 +00:00
parent 796aded2da
commit 850ae2f9fc
3 changed files with 9 additions and 1 deletions
+2
View File
@@ -105,12 +105,14 @@ def execute_jobs(jobs: list[dict]) -> None:
person_dir = _safe_person_dir(Config.OUTPUT_DIR, name)
except ValueError as e:
logger.error(str(e))
progress.remove_task(job_task)
continue
# Face crops are transient (uploaded then discarded); wipe before each run.
# A symlink could appear here via a TOCTOU race after _safe_person_dir
# returned — writing through it would land crops outside output_dir.
if os.path.islink(person_dir):
logger.error("person_dir %s became a symlink after path check — skipping job", person_dir)
progress.remove_task(job_task)
continue
if os.path.isdir(person_dir):
shutil.rmtree(person_dir)