V45.39: fix SERVER OFFLINE lau + UI load cham - engine ghi port file (engine_port.txt), UI bootstrap doc port engine cua chinh no (get_engine_port) + timeout/retry 60s, health poll self-heal reload, khong taskkill /IM daw_engine (giet engine instance khac), /api/v1/plugins/available chay scan trong threadpool (khong chan event loop -> /health het timeout)
This commit is contained in:
@@ -194,6 +194,14 @@ def get_scanner():
|
||||
|
||||
@router.get("/available")
|
||||
async def list_plugins(current_user: dict = Depends(get_current_user)):
|
||||
# Scan VST/SF chạy subprocess đồng bộ (fx_vst_bridge --scan, timeout 300s/
|
||||
# dir; Ozone treo tới 30s/module) — chạy trực tiếp trên event loop sẽ chặn
|
||||
# /health và mọi request khác → UI báo SERVER: OFFLINE suốt thời gian scan.
|
||||
# Chạy trong threadpool để event loop luôn phản hồi.
|
||||
return await asyncio.to_thread(_list_plugins_impl)
|
||||
|
||||
|
||||
def _list_plugins_impl():
|
||||
d = _effective_dirs()
|
||||
pm = PluginManager(vst_dir=d["vst_dir"], sf_dir=d["soundfont_dir"], upload_sf_dir=UPLOAD_SF_DIR, extra_vst_dirs=d["plugin_dirs"], user_dirs_override=d.get("plugin_dirs_user_set", False))
|
||||
avail = pm.list_available()
|
||||
|
||||
Reference in New Issue
Block a user