Celery task tasks.supply_layers_refresh computes L1/L2/L3 supply layers per Sverdlovsk district via supply_layers.compute_all_layers and UPSERTs into supply_layers (m.125) on uq_supply_layers_logical, updating all mutable cols (units/area/expected_online_date/confidence/method/computed_at), never the key. Coherent single date.today() snapshot_date across the batch; per-row SAVEPOINT (begin_nested) so a bad row/district can't abort the weekly batch; per-district guard. District set is data-driven (UNION of objective_lots.district and domrf_kn_objects.district_name region_cd=66), not hardcoded. Registered weekly Mon 06:00 МСК (after scrape_kn 04:15 that refreshes free_flats, the L2 source). Adds the task module to celery_app include (beat resolves by name). 11 unit tests asserting the ON CONFLICT contract + savepoint + coherent snapshot. |
||
|---|---|---|
| .. | ||
| api | ||
| core | ||
| models | ||
| observability | ||
| schemas | ||
| scrapers | ||
| services | ||
| templates | ||
| workers | ||
| __init__.py | ||
| main.py | ||