Skip to content

Commit

Permalink
add timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
0thernet committed May 6, 2024
1 parent 29be43b commit 574d330
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ dist
.envrc

.pypirc

examples/notebooks/scratch.py
2 changes: 1 addition & 1 deletion substrate/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,13 @@ def __init__(
api_key: str,
base_url: str,
backend: str,
timeout: float = 60 * 5.0,
additional_headers: Dict[str, Any] = {},
) -> None:
self._api_key = api_key
self._base_url = base_url
self._backend = backend
self._additional_headers = additional_headers
timeout = httpx.Timeout(60.0) # default is 5s
self._client = httpx.Client(timeout=timeout)
self._async_client = httpx.AsyncClient(timeout=timeout)
self._version = __version__
Expand Down

0 comments on commit 574d330

Please sign in to comment.