Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Weekly release 2024-11-25 #55

Merged
merged 2 commits into from
Nov 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions iiif/profiles/mss.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down
Loading