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:
+2
-1
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user