fix: split HTTP connect/read timeouts (Jellyfin build + qBit stats)

Every HTTP client passed an integer timeout to requests, applying the same
value to BOTH connect and read phases. A slow Jellyfin /Items page or qBit
/sync/maindata blew through the 10s read budget → ReadTimeoutError. Split
into a (connect=5s, read=60s default) tuple via shared http_timeout() helper.
The media index build worker uses a 180s read floor. Existing services with
low timeout_seconds benefit from bumping to 60+.
This commit is contained in:
Developer
2026-07-10 11:43:07 +00:00
parent 9bc8fab971
commit 044d386ac7
17 changed files with 152 additions and 29 deletions
@@ -31,7 +31,7 @@ def test_connection(
grafana_url = str(config.get("grafana_url") or "").rstrip("/")
api_key = str(secrets.get("grafana_api_key") or "")
datasource_uid = str(config.get("datasource_uid") or "prometheus")
timeout = int(config.get("timeout_seconds") or 10)
timeout = int(config.get("timeout_seconds") or 60)
if not grafana_url:
return TestResult(ok=False, detail="Grafana gateway URL is required.")
if not api_key:
@@ -73,7 +73,7 @@ class PrometheusConfig(ServiceConfigBase):
grafana_url: ServiceBaseUrl
datasource_uid: str = "prometheus"
timeout_seconds: int = 10
timeout_seconds: int = 60
class PrometheusMetricWidgetConfig(WidgetConfigBase):