From a1f05817fa5ea917916ca43c489cd093bb5a60e9 Mon Sep 17 00:00:00 2001 From: hbrain Date: Sat, 30 May 2026 20:55:38 +0000 Subject: [PATCH] Auto-cleanup local cache after job completion --- mvlog_worker.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/mvlog_worker.py b/mvlog_worker.py index ad3b48e..25340d2 100755 --- a/mvlog_worker.py +++ b/mvlog_worker.py @@ -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: