From 8e4fed5f0561ae8702badd345d4af3176d1b4887 Mon Sep 17 00:00:00 2001 From: locpham Date: Wed, 2 Sep 2026 12:41:16 +0700 Subject: [PATCH] fix(api): /fx-gui/close dong TAT CA bridge trung plugin (khong chi proc dau) --- app/api/v1/plugins.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/api/v1/plugins.py b/app/api/v1/plugins.py index 3a03799..073bed3 100644 --- a/app/api/v1/plugins.py +++ b/app/api/v1/plugins.py @@ -793,6 +793,7 @@ async def close_fx_gui(req: FxGuiCloseRequest, current_user: dict = Depends(get_ plugin_path = (req.path or "").strip() if not plugin_path: raise HTTPException(status_code=400, detail="Thiếu đường dẫn VST plugin.") + found = False for proc in _FX_GUI_PROCESSES: if proc is not None and proc.poll() is None and getattr(proc, "_sf_plugin_path", None) == plugin_path: proc.terminate() @@ -800,9 +801,9 @@ async def close_fx_gui(req: FxGuiCloseRequest, current_user: dict = Depends(get_ proc.wait(timeout=5) except Exception: proc.kill() - _prune_fx_gui_processes() - return {"success": True, "closed": True} - return {"success": True, "closed": False} + found = True + _prune_fx_gui_processes() + return {"success": True, "closed": found} _FX_GUI_PROCESSES = [] # list[subprocess.Popen] — các bridge fx-gui do app spawn