Skip to content

Commit 198718b

Browse files
authored
Merge pull request #14 from cloud-py-api/fix/local-ollama
fix: Increase the default timeout for requests to 10 minutes.
2 parents 5830556 + 8cbbe3f commit 198718b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ex_app/lib/main.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,8 @@ def enabled_callback(enabled: bool, nc: typing.Annotated[NextcloudApp, Depends(n
143143

144144

145145
async def proxy_request_to_service(request: Request, path: str, path_prefix: str = ""):
146-
async with httpx.AsyncClient() as client:
146+
# Creating a task can take a long time if using local LLM(ollama), so set the timeout to 10 minutes.
147+
async with httpx.AsyncClient(timeout=600.0) as client:
147148
url = f"{SERVICE_URL}{path_prefix}{path}" if path.startswith("/") else f"{SERVICE_URL}{path_prefix}/{path}"
148149
headers = {key: value for key, value in request.headers.items() if key.lower() not in ("host", "cookie")}
149150
if request.method == "GET":

0 commit comments

Comments
 (0)