Fix zombie upscaler processes by killing child processes and upscaler binaries in stop.py

This commit is contained in:
2026-06-30 10:05:44 -04:00
parent ae4f42e903
commit 2d1fa83d58
+12
View File
@@ -56,6 +56,18 @@ def stop() -> None:
print(f"🛑 Stopping server (PID {pid}) …")
# Clean up child processes of the server and any lingering upscaler binaries
import subprocess
try:
subprocess.run(["pkill", "-P", str(pid)], capture_output=True)
except Exception:
pass
try:
subprocess.run(["pkill", "-f", "realesrgan-ncnn-vulkan"], capture_output=True)
subprocess.run(["pkill", "-f", "rife-ncnn-vulkan"], capture_output=True)
except Exception:
pass
# Graceful shutdown (SIGTERM)
os.kill(pid, signal.SIGTERM)