Auto-cleanup local cache after job completion

This commit is contained in:
hbrain 2026-05-30 20:55:38 +00:00
parent 7d1e052326
commit a1f05817fa

View file

@ -343,6 +343,12 @@ def process_job(host: str, remote_root: str, job: str, work_dir: Path, extra_arg
})
write_state(host, job_dir, new_state)
print(f"published preview: {job} -> {preview_output}")
# Cleanup local cache
if local_input.exists():
shutil.rmtree(local_input)
if local_out.exists():
shutil.rmtree(local_out)
return
output = publish_output(host, remote_root, local_mp4, old_output)
@ -361,6 +367,12 @@ def process_job(host: str, remote_root: str, job: str, work_dir: Path, extra_arg
})
write_state(host, job_dir, new_state)
print(f"published: {job} -> {output}")
# Cleanup local cache after successful job
if local_input.exists():
shutil.rmtree(local_input)
if local_out.exists():
shutil.rmtree(local_out)
return
except Exception as exc:
try: