chore: Move timeout to recipe import
This commit is contained in:
@@ -9,7 +9,6 @@ from httpx import (
|
||||
BasicAuth,
|
||||
Request,
|
||||
Response,
|
||||
Timeout,
|
||||
)
|
||||
|
||||
from ..controllers.notes_search import NotesSearchController
|
||||
@@ -67,9 +66,6 @@ class NextcloudClient:
|
||||
auth=auth,
|
||||
transport=AsyncDisableCookieTransport(AsyncHTTPTransport()),
|
||||
event_hooks={"request": [log_request], "response": [log_response]},
|
||||
timeout=Timeout(
|
||||
30.0
|
||||
), # 30 second timeout for all operations including recipe imports
|
||||
)
|
||||
|
||||
# Initialize app clients
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
import logging
|
||||
from typing import Any, Dict, List
|
||||
|
||||
from httpx import Timeout
|
||||
|
||||
from .base import BaseNextcloudClient
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
@@ -127,7 +129,10 @@ class CookbookClient(BaseNextcloudClient):
|
||||
"""
|
||||
logger.info(f"Importing recipe from URL: {url}")
|
||||
response = await self._make_request(
|
||||
"POST", "/apps/cookbook/api/v1/import", json={"url": url}
|
||||
"POST",
|
||||
"/apps/cookbook/api/v1/import",
|
||||
json={"url": url},
|
||||
timeout=Timeout(60.0),
|
||||
)
|
||||
return response.json()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user