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 |
||
|---|---|---|
| .. | ||
| analysis_runs | ||
| analytics | ||
| cadastre | ||
| chat | ||
| etl | ||
| exporters | ||
| forecasting | ||
| generative | ||
| llm | ||
| photos | ||
| scrapers | ||
| site_finder | ||
| __init__.py | ||
| analytics_queries.py | ||
| analytics_refresh.py | ||
| forecast_request_cache.py | ||
| insights.py | ||
| job_settings.py | ||
| objective_etl.py | ||
| objective_sync_config.py | ||
| own_projects.py | ||
| weather_cache.py | ||