fix(api): /fx-gui/close dong TAT CA bridge trung plugin (khong chi proc dau)

This commit is contained in:
2026-09-02 12:41:16 +07:00
parent 33c5cc290f
commit 8e4fed5f05
+4 -3
View File
@@ -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