Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#521)
Browse files Browse the repository at this point in the history
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.6.5 → v0.6.7](astral-sh/ruff-pre-commit@v0.6.5...v0.6.7)
- [github.com/PyCQA/bandit: 1.7.9 → 1.7.10](PyCQA/bandit@1.7.9...1.7.10)

* Add timeout to httpx requests

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Casper Welzel Andersen <casper.w.andersen@sintef.no>
  • Loading branch information
pre-commit-ci[bot] and CasperWA authored Sep 24, 2024
1 parent 298ab97 commit b4c0492
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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]
Expand Down
4 changes: 2 additions & 2 deletions optimade_gateway/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit b4c0492

Please sign in to comment.