Skip to content

Commit

Permalink
chore: increase default requests timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
gabriel-milan committed Apr 15, 2024
1 parent e62b3d7 commit b42746a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions app/config/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,6 @@

# Host
HOST = socket.gethostname()

# Requests timeout
REQUESTS_DEFAULT_TIMEOUT = int(getenv_or_action("REQUESTS_DEFAULT_TIMEOUT", default="30"))
2 changes: 1 addition & 1 deletion app/routers/proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ async def options():
"""
Proxies requests to the Prefect API.
"""
async with httpx.AsyncClient() as client:
async with httpx.AsyncClient(timeout=config.REQUESTS_DEFAULT_TIMEOUT) as client:
response = await client.options(
config.PREFECT_API_URL,
)
Expand Down
2 changes: 1 addition & 1 deletion app/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ async def graphql_request(operations: dict) -> httpx.Response:
Returns:
bytes: The response from Prefect backend.
"""
async with httpx.AsyncClient() as client:
async with httpx.AsyncClient(timeout=config.REQUESTS_DEFAULT_TIMEOUT) as client:
response = await client.post(
config.PREFECT_API_URL,
json=operations,
Expand Down

0 comments on commit b42746a

Please sign in to comment.