From c8a9b4d7cb67dd7fa3560b3ca09ea18e0d9ea71b Mon Sep 17 00:00:00 2001 From: Josh Patra Date: Tue, 7 Jul 2026 18:26:50 -0400 Subject: [PATCH] fix(gamdl-aio): resolve login deadlock by checking daemon process health instead of requiring wrapper_api client during login --- gamdl-aio/main.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/gamdl-aio/main.py b/gamdl-aio/main.py index 11c9a469..09ac6d75 100644 --- a/gamdl-aio/main.py +++ b/gamdl-aio/main.py @@ -159,8 +159,9 @@ async def health_check(): @app.get("/api/me") async def get_me(): - if not wrapper_api: - return {"logged_in": False, "error": "Wrapper API not initialized"} + daemon_running = wrapper_proc is not None and wrapper_proc.poll() is None + if not daemon_running: + return {"logged_in": False, "error": "Wrapper daemon is not running"} try: import httpx @@ -172,8 +173,9 @@ async def get_me(): @app.post("/api/login") async def login(req: LoginRequest): - if not wrapper_api: - raise HTTPException(status_code=503, detail="Wrapper API not ready") + daemon_running = wrapper_proc is not None and wrapper_proc.poll() is None + if not daemon_running: + raise HTTPException(status_code=503, detail="Wrapper daemon is not running") try: import httpx @@ -191,8 +193,9 @@ async def login(req: LoginRequest): @app.post("/api/login/2fa") async def login_2fa(req: Login2FARequest): - if not wrapper_api: - raise HTTPException(status_code=503, detail="Wrapper API not ready") + daemon_running = wrapper_proc is not None and wrapper_proc.poll() is None + if not daemon_running: + raise HTTPException(status_code=503, detail="Wrapper daemon is not running") try: import httpx