V10.576 修正 GCP-only Ollama retry
All checks were successful
CD Pipeline / deploy (push) Successful in 1m5s
All checks were successful
CD Pipeline / deploy (push) Successful in 1m5s
This commit is contained in:
@@ -638,9 +638,18 @@ class OllamaService:
|
||||
for attempt in range(max_attempts):
|
||||
current_host = _normalize_host(self.host) # property 每次 lazy resolve
|
||||
if not allow_111_fallback and _is_111_fallback_host(current_host):
|
||||
last_error = "111 fallback disabled; no approved GCP Ollama host available"
|
||||
logger.warning("[Ollama] %s", last_error)
|
||||
break
|
||||
next_host = next((host for host in allowed_hosts if host not in attempted_hosts), None)
|
||||
if not next_host:
|
||||
last_error = "111 fallback disabled; no approved GCP Ollama host available"
|
||||
logger.warning("[Ollama] %s", last_error)
|
||||
break
|
||||
logger.info(
|
||||
"[Ollama] resolver selected 111 but caller disabled fallback; forcing approved GCP host=%s",
|
||||
next_host,
|
||||
)
|
||||
if self._explicit_host is None:
|
||||
_clear_resolved_host_cache()
|
||||
current_host = next_host
|
||||
if current_host in attempted_hosts:
|
||||
# 已試過同主機時,若是標準三主機鏈且 caller 沒指定 host,
|
||||
# 改走尚未嘗試的下一台。避免 request timeout(60s) 大於
|
||||
|
||||
Reference in New Issue
Block a user