Samad14 commited on
Commit
01cccda
·
1 Parent(s): ab38821

debug: set Vina timeout to 60s for testing timeout mechanism

Browse files
bioai-platform/backend/app/tools/docking.py CHANGED
@@ -33,7 +33,7 @@ async def _run_vina_with_timeout(
33
  timeout=timeout + 30,
34
  )
35
  except subprocess.TimeoutExpired:
36
- raise asyncio.TimeoutError(f"Vina timed out after {timeout}s")
37
  with open(stdout_path, "wb") as f:
38
  f.write(r.stdout or b"")
39
  with open(stderr_path, "wb") as f:
@@ -613,13 +613,13 @@ class DockingTool(BaseTool):
613
  "--num_modes", "3"],
614
  stdout_path=vina_stdout,
615
  stderr_path=vina_stderr,
616
- timeout=600,
617
  )
618
  with open(vina_stderr, "r") as f:
619
  stderr_str = f.read()
620
  except asyncio.TimeoutError:
621
- logger.error("Vina timed out after 600s")
622
- return {"error": "Docking timed out after 10 minutes"}
623
  except Exception as exc:
624
  logger.exception("Vina subprocess failed to start")
625
  return {"error": f"Vina execution failed: {exc}"}
 
33
  timeout=timeout + 30,
34
  )
35
  except subprocess.TimeoutExpired:
36
+ raise asyncio.TimeoutError(f"Vina timed out after {timeout}s (subprocess)")
37
  with open(stdout_path, "wb") as f:
38
  f.write(r.stdout or b"")
39
  with open(stderr_path, "wb") as f:
 
613
  "--num_modes", "3"],
614
  stdout_path=vina_stdout,
615
  stderr_path=vina_stderr,
616
+ timeout=60,
617
  )
618
  with open(vina_stderr, "r") as f:
619
  stderr_str = f.read()
620
  except asyncio.TimeoutError:
621
+ logger.error("Vina timed out after 60s")
622
+ return {"error": "Docking timed out after 60 seconds"}
623
  except Exception as exc:
624
  logger.exception("Vina subprocess failed to start")
625
  return {"error": f"Vina execution failed: {exc}"}