Fix Local Agent 1.13.1 Windows dashboard startup

This commit is contained in:
A R R R Associates
2026-08-22 19:36:51 +05:30
parent 4b0ac5ce2b
commit 215ad2c6c6
5 changed files with 43 additions and 7 deletions
@@ -35,13 +35,48 @@ def _popup(title: str, message: str, error: bool = False) -> None:
def _pid_alive(pid: int) -> bool:
if pid <= 0:
return False
if os.name == "nt":
try:
import ctypes
PROCESS_QUERY_LIMITED_INFORMATION = 0x1000
STILL_ACTIVE = 259
kernel32 = ctypes.windll.kernel32
handle = kernel32.OpenProcess(
PROCESS_QUERY_LIMITED_INFORMATION,
False,
int(pid),
)
if not handle:
return False
try:
exit_code = ctypes.c_ulong()
if not kernel32.GetExitCodeProcess(
handle,
ctypes.byref(exit_code),
):
return False
return exit_code.value == STILL_ACTIVE
finally:
kernel32.CloseHandle(handle)
except Exception:
return False
try:
os.kill(pid, 0)
return True
except OSError:
return False
def _supervisor_running() -> bool:
try:
if not SUPERVISOR_LOCK.exists():