diff --git a/compose.yml b/compose.yml index a048ffb..1be4058 100644 --- a/compose.yml +++ b/compose.yml @@ -25,10 +25,12 @@ services: # ── Scheduling ── # Cron expression (unset = run once and exit) - - CRON_SCHEDULE=0 3 * * 0 # Every Sunday at 3 AM - # - CRON_SCHEDULE=0 3 1 * * # 1st of every month at 3 AM - # - CRON_SCHEDULE=*/30 * * * * # Every 30 minutes (testing) + # Every Sunday at 3 AM: + - CRON_SCHEDULE=0 3 * * 0 + # - CRON_SCHEDULE=0 3 1 * * + # - CRON_SCHEDULE=*/30 * * * * volumes: + # Replace with your TrueNAS pool name, e.g. /mnt/tank/if-curator/... - /mnt//if-curator/models:/models - /mnt//if-curator/embeddings:/app/.if_cache - /mnt//if-curator/output:/app/output diff --git a/if_curator/executor.py b/if_curator/executor.py index 14fd53e..850af69 100644 --- a/if_curator/executor.py +++ b/if_curator/executor.py @@ -2,6 +2,7 @@ import logging import os +import shutil from io import BytesIO from urllib.parse import quote @@ -89,7 +90,9 @@ def execute_jobs(jobs: list[dict]) -> None: job_task = progress.add_task(f"Processing {name}...", total=len(assets)) person_dir = os.path.join(Config.OUTPUT_DIR, name) - os.makedirs(person_dir, exist_ok=True) + if os.path.isdir(person_dir): + shutil.rmtree(person_dir) + os.makedirs(person_dir) # Track filename → asset_id mapping for upload dedup asset_map: dict[str, str] = {}