diff --git a/bincio/serve/server.py b/bincio/serve/server.py index 4857ad3..3b544c7 100644 --- a/bincio/serve/server.py +++ b/bincio/serve/server.py @@ -11,6 +11,7 @@ from __future__ import annotations import json import re import secrets +import shutil import subprocess import time from pathlib import Path @@ -168,14 +169,18 @@ def _trigger_rebuild(handle: str) -> None: return if not _VALID_HANDLE.match(handle): return # safety: never pass untrusted strings to subprocess - subprocess.Popen( - ["uv", "run", "bincio", "render", - "--data-dir", str(data_dir), - "--site-dir", str(site_dir), - "--handle", handle], - stdout=subprocess.DEVNULL, - stderr=subprocess.DEVNULL, - ) + uv = shutil.which("uv") or str(Path.home() / ".local" / "bin" / "uv") + try: + subprocess.Popen( + [uv, "run", "bincio", "render", + "--data-dir", str(data_dir), + "--site-dir", str(site_dir), + "--handle", handle], + stdout=subprocess.DEVNULL, + stderr=subprocess.DEVNULL, + ) + except Exception: + pass # rebuild failure must never 500 the calling endpoint # ── Auth endpoints ────────────────────────────────────────────────────────────