feat(docreader): add quick availability probe for opendataloader parser

Add a `quick` flag to `opendataloader_available` so registry listing can use
a single short-timeout health check instead of the patient retry/backoff loop.
Parsing keeps the original tolerant probe to handle a hybrid service that is
still starting up.
This commit is contained in:
wizardchen
2026-06-16 16:34:05 +08:00
committed by lyingbug
parent 6d07e20204
commit b58232e65b
2 changed files with 11 additions and 6 deletions
+10 -1
View File
@@ -98,8 +98,15 @@ def _ping_hybrid(
def opendataloader_available(
overrides: Optional[Mapping[str, Any]] = None,
quick: bool = False,
) -> Tuple[bool, str]:
"""Registry / ListEngines availability probe."""
"""Registry / ListEngines availability probe.
When ``quick`` is set the hybrid health check uses a single short-timeout
attempt with no retries, so it can be used for fast status listing without
blocking on long retry/backoff loops. Parsing keeps the patient retry
behavior to tolerate a hybrid service that is still starting up.
"""
ok, msg = _java_available()
if not ok:
return False, msg
@@ -111,6 +118,8 @@ def opendataloader_available(
if hybrid and hybrid.lower() not in ("off", ""):
url = _resolve_hybrid_url(overrides)
if url:
if quick:
return _ping_hybrid(url, retries=1, timeout_sec=2.0)
return _ping_hybrid(url, retries=6, retry_delay_sec=5.0, timeout_sec=5.0)
return True, ""