Browse Source
🐛 Fix FastAPI People GitHub Action: set HTTPX timeout for GraphQL query 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>
pull/5347/head
Irfanuddin Shafi Ahmed
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
3 additions and
1 deletions
-
.github/actions/people/app/main.py
|
@ -260,6 +260,7 @@ class Settings(BaseSettings): |
|
|
input_token: SecretStr |
|
|
input_token: SecretStr |
|
|
input_standard_token: SecretStr |
|
|
input_standard_token: SecretStr |
|
|
github_repository: str |
|
|
github_repository: str |
|
|
|
|
|
httpx_timeout: int = 30 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def get_graphql_response( |
|
|
def get_graphql_response( |
|
@ -270,9 +271,10 @@ def get_graphql_response( |
|
|
response = httpx.post( |
|
|
response = httpx.post( |
|
|
github_graphql_url, |
|
|
github_graphql_url, |
|
|
headers=headers, |
|
|
headers=headers, |
|
|
|
|
|
timeout=settings.httpx_timeout, |
|
|
json={"query": query, "variables": variables, "operationName": "Q"}, |
|
|
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(f"Response was not 200, after: {after}") |
|
|
logging.error(response.text) |
|
|
logging.error(response.text) |
|
|
raise RuntimeError(response.text) |
|
|
raise RuntimeError(response.text) |
|
|