]> git.ipfire.org Git - thirdparty/fastapi/fastapi.git/commitdiff
🐛 Fix FastAPI People GitHub Action: set HTTPX timeout for GraphQL query request ...
authorIrfanuddin Shafi Ahmed <irfanudeen08@gmail.com>
Sun, 4 Sep 2022 15:07:12 +0000 (20:37 +0530)
committerGitHub <noreply@github.com>
Sun, 4 Sep 2022 15:07:12 +0000 (15:07 +0000)
Co-authored-by: Irfanuddin <irfanuddin@knowledgelens.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
.github/actions/people/app/main.py

index 1455d01caeee586fe2f6bf0123c3435e413cea6a..cdf423b97baa8489dbf98386ea79079d84fe21b1 100644 (file)
@@ -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)