diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ed77af40..6486b29f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -40,7 +40,7 @@ repos: - id: black - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.6.5 + rev: v0.6.7 hooks: - id: ruff args: @@ -50,7 +50,7 @@ repos: - --exit-non-zero-on-fix - repo: https://github.com/PyCQA/bandit - rev: '1.7.9' + rev: '1.7.10' hooks: - id: bandit args: [-r] diff --git a/optimade_gateway/events.py b/optimade_gateway/events.py index 487cd31e..60c48264 100644 --- a/optimade_gateway/events.py +++ b/optimade_gateway/events.py @@ -92,7 +92,7 @@ async def load_optimade_providers_databases() -> None: if TYPE_CHECKING or bool(os.getenv("MKDOCS_BUILD", "")): # pragma: no cover providers: httpx.Response | LinksResponse - async with httpx.AsyncClient() as client: + async with httpx.AsyncClient(timeout=5.0) as client: providers = await client.get( "https://providers.optimade.org/v" f"{__api_version__.split('.', maxsplit=1)[0]}/links" @@ -187,7 +187,7 @@ async def load_optimade_providers_databases() -> None: get_resource_attribute(database, "id"), ) - async with httpx.AsyncClient() as client: + async with httpx.AsyncClient(timeout=5.0) as client: try: db_response = await client.get( f"{str(get_resource_attribute(database, 'attributes.base_url')).rstrip('/')}" # noqa: E501