Added global timeout and import for httpx
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
|
import httpx
|
||||||
|
|
||||||
class BaseAPI():
|
class BaseAPI():
|
||||||
async def __aenter__(self):
|
async def __aenter__(self):
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ class DRBCDBAPI(BaseAPI):
|
|||||||
super().__init__()
|
super().__init__()
|
||||||
self.base_url = base_url
|
self.base_url = base_url
|
||||||
# Use an AsyncClient for making asynchronous requests
|
# Use an AsyncClient for making asynchronous requests
|
||||||
self._client = httpx.AsyncClient()
|
self._client = httpx.AsyncClient(timeout=30)
|
||||||
|
|
||||||
# --- OP25 Endpoints ---
|
# --- OP25 Endpoints ---
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user