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:
2026-09-01 16:45:06 +07:00
parent 1e0314249d
commit 2c4d6c358b
7 changed files with 2849 additions and 2756 deletions
+11
View File
@@ -116,6 +116,17 @@ def main():
port = _pick_port()
os.environ["SF_PORT"] = str(port)
# Announce port to Tauri shell: UI bootstrap đọc %APPDATA%/SonicForgeDAW/
# engine_port.txt (qua lệnh get_engine_port) để kết nối ĐÚNG engine của
# chính nó thay vì quét port — quét 8000-8010 có thể dính engine của
# instance khác (2 app chạy cùng lúc) → UI mất server khi instance đó tắt.
try:
port_file = os.path.join(os.path.dirname(log_dir), "engine_port.txt")
with open(port_file, "w", encoding="utf-8") as f:
f.write(str(port))
except OSError:
pass
# Log ra file — khi dong goi console=False, stdout khong nhin thay duoc.
try:
logging.basicConfig(