fix: cantaloupe export subprocess cwd points to cantaloupe-downloader project

The subprocess.run for cantaloupe export was using cwd=admin_server_dir,
which meant 'python -m cantaloupe' couldn't find the local cantaloupe module.
Changed cwd to ~/projects/cantaloupe-downloader where the module lives.

Also added scripts/cantaloupe-sync.sh — the 6h cron job wrapper script.
This commit is contained in:
Leo
2026-05-21 19:32:44 -04:00
parent f7ffa0e6cc
commit e9d18cb8b7
2 changed files with 53 additions and 1 deletions
+2 -1
View File
@@ -419,10 +419,11 @@ async def run_sync(
# Try subprocess call to cantaloupe export
try:
import subprocess
cantaloupe_dir = os.path.expanduser("~/projects/cantaloupe-downloader")
result = subprocess.run(
["python", "-m", "cantaloupe", "export", "--scheduled"],
capture_output=True, text=True, timeout=120,
cwd=str(Path(__file__).parent),
cwd=cantaloupe_dir,
)
if result.returncode != 0:
raise HTTPException(