[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci
This commit is contained in:
pre-commit-ci[bot] 2026-06-18 07:09:41 +00:00
commit 60576a9c9c
3 changed files with 1 additions and 6 deletions

View file

@ -6158,7 +6158,6 @@ class LlamaCppBackend:
isolated, mirroring the reaper's custom-root isolation)."""
try:
from utils.paths.storage_roots import studio_root # noqa: WPS433
return studio_root() / "llama-server.pid"
except Exception:
return None
@ -6193,7 +6192,6 @@ class LlamaCppBackend:
uncertainty so an unrelated process is never killed."""
try:
import psutil
try:
proc = psutil.Process(pid)
if (proc.name() or "").lower().startswith("llama-server"):

View file

@ -482,7 +482,6 @@ async def lifespan(app: FastAPI):
# Mirror run.py's _graceful_shutdown step 5 so a direct-uvicorn shutdown
# (which bypasses the signal handler) also kills the GPU child.
from routes.inference import _llama_cpp_backend
if _llama_cpp_backend is not None:
_llama_cpp_backend._kill_process()

View file

@ -463,9 +463,7 @@ def test_reap_recorded_pid_skips_pid_reuse(tmp_path):
try:
with (
patch.object(LlamaCppBackend, "_server_pidfile_path", staticmethod(lambda: pidfile)),
patch.object(
LlamaCppBackend, "_pid_is_llama_server", staticmethod(lambda pid: False)
),
patch.object(LlamaCppBackend, "_pid_is_llama_server", staticmethod(lambda pid: False)),
):
n = LlamaCppBackend._reap_recorded_pid()
assert n == 0