V45.39b: engine_port.txt ghi port+engine_exe_path, get_engine_port doi chieu path engine cua chinh app (2 instance khong doc lan port cua nhau)
This commit is contained in:
+3
-1
@@ -120,10 +120,12 @@ def main():
|
||||
# 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.
|
||||
# Format "port\nengine_exe_path": Tauri đối chiếu path engine với candidate
|
||||
# của CHÍNH nó → 2 app chạy song song mỗi cái lấy đúng port của mình.
|
||||
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))
|
||||
f.write("%d\n%s" % (port, sys.executable))
|
||||
except OSError:
|
||||
pass
|
||||
|
||||
|
||||
Reference in New Issue
Block a user