From 4cff206ebb925acfa4904bb5ddf62c6748f8b15f Mon Sep 17 00:00:00 2001 From: Irfanuddin Shafi Ahmed Date: Sun, 4 Sep 2022 20:37:12 +0530 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20FastAPI=20People=20GitHub?= =?UTF-8?q?=20Action:=20set=20HTTPX=20timeout=20for=20GraphQL=20query=20re?= =?UTF-8?q?quest=20(#5222)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Irfanuddin Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Sebastián Ramírez --- .github/actions/people/app/main.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/actions/people/app/main.py b/.github/actions/people/app/main.py index 1455d01ca..cdf423b97 100644 --- a/.github/actions/people/app/main.py +++ b/.github/actions/people/app/main.py @@ -260,6 +260,7 @@ class Settings(BaseSettings): input_token: SecretStr input_standard_token: SecretStr github_repository: str + httpx_timeout: int = 30 def get_graphql_response( @@ -270,9 +271,10 @@ def get_graphql_response( response = httpx.post( github_graphql_url, headers=headers, + timeout=settings.httpx_timeout, json={"query": query, "variables": variables, "operationName": "Q"}, ) - if not response.status_code == 200: + if response.status_code != 200: logging.error(f"Response was not 200, after: {after}") logging.error(response.text) raise RuntimeError(response.text)