fix: clean output dir per run, fix cron inline comment, clarify volume placeholder
- executor.py: wipe person output dir before each run so stale crops from previous runs don't accumulate on disk - compose.yml: move inline comment off CRON_SCHEDULE value (croniter would parse the comment text as part of the expression) - compose.yml: add note clarifying <pool> placeholder in volume paths Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+5
-3
@@ -25,10 +25,12 @@ services:
|
|||||||
|
|
||||||
# ── Scheduling ──
|
# ── Scheduling ──
|
||||||
# Cron expression (unset = run once and exit)
|
# Cron expression (unset = run once and exit)
|
||||||
- CRON_SCHEDULE=0 3 * * 0 # Every Sunday at 3 AM
|
# Every Sunday at 3 AM:
|
||||||
# - CRON_SCHEDULE=0 3 1 * * # 1st of every month at 3 AM
|
- CRON_SCHEDULE=0 3 * * 0
|
||||||
# - CRON_SCHEDULE=*/30 * * * * # Every 30 minutes (testing)
|
# - CRON_SCHEDULE=0 3 1 * *
|
||||||
|
# - CRON_SCHEDULE=*/30 * * * *
|
||||||
volumes:
|
volumes:
|
||||||
|
# Replace <pool> with your TrueNAS pool name, e.g. /mnt/tank/if-curator/...
|
||||||
- /mnt/<pool>/if-curator/models:/models
|
- /mnt/<pool>/if-curator/models:/models
|
||||||
- /mnt/<pool>/if-curator/embeddings:/app/.if_cache
|
- /mnt/<pool>/if-curator/embeddings:/app/.if_cache
|
||||||
- /mnt/<pool>/if-curator/output:/app/output
|
- /mnt/<pool>/if-curator/output:/app/output
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
|
import shutil
|
||||||
from io import BytesIO
|
from io import BytesIO
|
||||||
from urllib.parse import quote
|
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))
|
job_task = progress.add_task(f"Processing {name}...", total=len(assets))
|
||||||
person_dir = os.path.join(Config.OUTPUT_DIR, name)
|
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
|
# Track filename → asset_id mapping for upload dedup
|
||||||
asset_map: dict[str, str] = {}
|
asset_map: dict[str, str] = {}
|
||||||
|
|||||||
Reference in New Issue
Block a user