Was: 30-day staleness window (catalog_scraped_at < NOW() - INTERVAL '30 days')
Now: skip только если catalog_scraped_at = сегодня; новые (NULL) и вчерашние
грузим всегда. Admin endpoint и beat task получили `force: bool = False` —
True игнорирует skip и грузит все объекты последнего snapshot (кнопка
"Загрузить все").
- SQL: WHERE (CAST(:force AS boolean) OR catalog_scraped_at IS NULL
OR DATE(catalog_scraped_at) < CURRENT_DATE)
- Task signature: scrape_kn_catalog_objects(region_code, max_objects, force)
- Admin POST /admin/scrape/kn-catalog-objects payload: + force: bool
- Tests: 5 новых (skip-today active, force passthrough, max_objects,
rows processed, SQL contains skip-today predicate)
Зачем: full sweep на 1532 obj — ~50 мин/run. До сих пор повторный запуск
после партиала всё равно проходил тот же batch — нет признака "уже
обновлено сегодня". Кнопка "Загрузить все" остаётся для force-pass всего
региона (например после schema change).
|
||
|---|---|---|
| .. | ||
| api | ||
| integration | ||
| scrapers | ||
| services | ||
| smoke | ||
| workers | ||
| __init__.py | ||
| test_admin_weight_profiles.py | ||
| test_concepts_stub.py | ||
| test_gate_verdict.py | ||
| test_health.py | ||
| test_layout_signature.py | ||
| test_layout_tz_pdf.py | ||
| test_nspd_client.py | ||
| test_nspd_sync.py | ||
| test_poi_score.py | ||
| test_quarter_dump_lookup.py | ||
| test_sentry_init.py | ||
| test_velocity.py | ||
| test_weight_profiles.py | ||