Skip to content

Commit

Permalink
🐛 Fix FastAPI People GitHub Action: set HTTPX timeout for GraphQL que…
Browse files Browse the repository at this point in the history
…ry request (#5222)

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>
  • Loading branch information
4 people committed Sep 4, 2022
1 parent 0195bb5 commit 4cff206
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .github/actions/people/app/main.py
Expand Up @@ -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(
Expand All @@ -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)
Expand Down

0 comments on commit 4cff206

Please sign in to comment.