get_or_fetch_zone_regulation no longer commits the shared /analyze transaction mid-request on cache-miss. The upsert now runs in a fresh short-lived SessionLocal() (commit/rollback/close), mirroring the zone_regulation_refresh Celery task. Read-back still uses the shared session (READ COMMITTED sees the committed row), so caller return shape is unchanged. Resolves the #1850 item-4 SMELL (the outer analyze tx is designed to commit exactly once via persist_analysis_run). Refs #1850 |
||
|---|---|---|
| .. | ||
| api | ||
| core | ||
| models | ||
| observability | ||
| schemas | ||
| scrapers | ||
| services | ||
| templates | ||
| workers | ||
| __init__.py | ||
| main.py | ||