diff --git a/CHANGELOG.md b/CHANGELOG.md index f8630fc..10cc9ed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## v0.16.3 (2024-11-25) + +### Fix + +- decrease total response timeout to 5s for mss status check + ## v0.16.2 (2024-07-22) ### Fix diff --git a/iiif/profiles/mss.py b/iiif/profiles/mss.py index fce6edd..4b377e2 100644 --- a/iiif/profiles/mss.py +++ b/iiif/profiles/mss.py @@ -7,7 +7,7 @@ import shutil import tempfile import time -from aiohttp import ClientResponse, ClientError +from aiohttp import ClientResponse, ClientError, ClientTimeout from cachetools import TTLCache from contextlib import asynccontextmanager from dataclasses import dataclass @@ -438,7 +438,8 @@ async def get_status(self) -> dict: try: health_url = f'{next(self.es_hosts)}/_cluster/health' start_time = time.monotonic() - async with self.es_session.get(health_url) as response: + async with self.es_session.get(health_url, + timeout=ClientTimeout(total=5)) as response: return { 'status': (await response.json())['status'], 'response_time': time.monotonic() - start_time @@ -639,7 +640,8 @@ async def get_status(self) -> dict: status['error_breakdown'] = self.stream_errors try: start_time = time.monotonic() - async with self.mss_session.get('/nhmlive/status') as response: + async with self.mss_session.get('/nhmlive/status', + timeout=ClientTimeout(total=5)) as response: status['mss_status'] = { **(await response.json()), 'response_time': time.monotonic() - start_time, diff --git a/pyproject.toml b/pyproject.toml index 9363a14..55bd898 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta" [tool] [tool.commitizen] name = "cz_nhm" -version = "0.16.2" +version = "0.16.3" tag_format = "v$version" update_changelog_on_bump = true changelog_incremental = true diff --git a/setup.cfg b/setup.cfg index c0ac281..0104cc3 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = iiif-image-server -version = 0.16.2 +version = 0.16.3 description = A IIIF enabled media server primarily used by the NHM Data Portal long_description = file: README.md license_files = LICENSE