fix(embed): fast-fail + auto-restart Ollama on solved-search hang

Embeddings timeout was 120s, causing multi-minute hangs when Ollama was
down during F4/F6/F7 solved-search. Now: connect_timeout=5s across all
HTTP clients (REST + Ollama), read_timeout reduced to 30s for embeddings,
and OllamaEmbeddings auto-restarts the server on ConnectionError before
degrading gracefully.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-07-07 19:49:55 +02:00
co-authored by Claude Opus 4.6
parent 893ad99594
commit 1e4bc11418
5 changed files with 65 additions and 9 deletions
+3 -1
View File
@@ -52,6 +52,7 @@ class RestConfig(BaseModel):
base_url: str
api_key: str
timeout: int = 30
connect_timeout: int = 5
ssl_ca: str | None = None # path al certificato CA (per server con CA interna)
@@ -105,7 +106,8 @@ class EmbeddingsConfig(BaseModel):
model: str = "nomic-embed-text-v2-moe"
dim: int = 768
batch_size: int = 32
timeout: int = 120
timeout: int = 30
connect_timeout: int = 5
bin: str = "ollama"
start_cmd: list[str] | None = None