diff --git a/src/api/toolchain_routes.py b/src/api/toolchain_routes.py index e04cbc6..af49557 100644 --- a/src/api/toolchain_routes.py +++ b/src/api/toolchain_routes.py @@ -464,12 +464,12 @@ async def _handle_issue_comment(payload: Dict[str, Any]) -> None: sha_match = re.search(r"commit:\s*`?([0-9a-f]{40})`?", body) if sha_match: try: - resp = requests.get( - f"{_GITEA_BASE}/commits/{sha_match.group(1)}/status", - headers={"Authorization": f"token {_GITEA_TOKEN}"}, - timeout=5, - ) - if resp.ok: + async with httpx.AsyncClient(timeout=5.0) as client: + resp = await client.get( + f"{_GITEA_BASE}/commits/{sha_match.group(1)}/status", + headers={"Authorization": f"token {_GITEA_TOKEN}"}, + ) + if resp.status_code == 200: statuses = resp.json().get("statuses", []) for s in statuses: if s.get("status") == "failure" or s.get("state") == "failure":