refactor(stage-3): add Keep-Alive connection pool for Ollama, implement offline lemma resolution in dictionary

This commit is contained in:
Antigravity committed 2026-10-07 14:45:05 +03:00
1 parent 9072fc365a
commit 4e1f809018
3 files changed
+131 -82

No files matched your search

+2 -1
View File
@@ -36,7 +36,7 @@ from app.reader import (
fetch_and_parse_rfc, parse_rfc_text, fetch_and_parse_wikipedia,
extract_wikipedia_title_and_lang
)
from app.ai import translate_sentence_ai, get_ollama_status, warmup_ollama_model
from app.ai import translate_sentence_ai, get_ollama_status, warmup_ollama_model, close_ollama_client
from app.phrasal import detect_phrasal_verb
from app.cefr import (
get_cefr_level_summaries,
@@ -97,6 +97,7 @@ async def lifespan(app: FastAPI):
asyncio.create_task(prewarm_all_listening_audio())
yield
await close_http_client()
await close_ollama_client()
app = FastAPI(