Skip to content
This repository has been archived by the owner on Dec 10, 2024. It is now read-only.

Commit

Permalink
bump default api timeout 10s -> 30s
Browse files Browse the repository at this point in the history
  • Loading branch information
sam-mellor committed Oct 23, 2024
1 parent fe589c2 commit 29ec676
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/faebryk/libs/picker/api/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
logger = logging.getLogger(__name__)

DEFAULT_API_URL = "https://api-6121-5335559d-q87t043v.onporter.run/"
DEFAULT_API_TIMEOUT_SECONDS = 30
API_URL = ConfigFlagString("PICKER_API_URL", DEFAULT_API_URL, "API URL")
API_KEY = ConfigFlagString("PICKER_API_KEY", "", "API key")

Expand Down Expand Up @@ -180,7 +181,9 @@ def _get(self, url: str, timeout: float = 10) -> requests.Response:

return response

def _post(self, url: str, data: dict, timeout: float = 10) -> requests.Response:
def _post(
self, url: str, data: dict, timeout: float = DEFAULT_API_TIMEOUT_SECONDS
) -> requests.Response:
try:
response = self._client.post(
f"{self.config.api_url}{url}", json=data, timeout=timeout
Expand Down

0 comments on commit 29ec676

Please sign in to comment.