feat(ocr): flip ocr_models_ready to 1 once the lifespan startup finishes

Mirrors the existing _models_ready bool so Prometheus has a time-series
liveness/readiness signal for future alerting rules (e.g.
ocr_models_ready < 1 for 2m).

Refs #652 (AC7)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Marcel
2026-05-21 16:15:11 +02:00
parent 77d59c5d83
commit d6abf990c7
2 changed files with 21 additions and 0 deletions

View File

@@ -69,6 +69,7 @@ async def lifespan(app: FastAPI):
kraken_engine.load_models()
load_spell_checker()
_models_ready = True
metrics.ocr_models_ready.set(1)
logger.info("Startup complete — ready to accept requests")
yield