Merge pull request 'fix(#231): re-enable nspd-harvest-stale-quarters beat schedule (Sub-PR D)' (#267) from fix/231-nspd-beat-reenable into main
All checks were successful
Deploy / build-worker (push) Successful in 2m38s
Deploy / deploy (push) Successful in 47s
Deploy / changes (push) Successful in 5s
Deploy / build-backend (push) Successful in 1m33s
Deploy / build-frontend (push) Has been skipped

This commit is contained in:
lekss361 2026-05-17 07:50:34 +00:00
commit ee0bad445d

View file

@ -237,23 +237,21 @@ def build_beat_schedule() -> dict:
"options": {"queue": "celery"},
}
# NSPD quarter dump refresh — DISABLED 2026-05-14 per Bug_NSPD_WMS_NotBulk
# post-mortem (vault: fixes/Bug_NSPD_WMS_NotBulk_2026_May14.md).
# NSPD quarter dump refresh — re-enabled 2026-05-17 после Sub-PR B (#260)
# переключения search_by_quarter на grid-walk. Foundation (#247) + integration
# (#260) теперь возвращают полноценные dumps (territorial_zones, ЗОУИТ, risk
# zones, engineering structures) вместо 0-3 features из single-pixel WMS.
#
# Action item #1: disable beat schedule до Sprint 2 fix (grid sampling
# rewrite). harvest_quarter в текущей реализации пишет почти пустые dumps
# из-за single-pixel WMS GetFeatureInfo bug. Запуск Mon 04:00 МСК потратит
# rate-limit budget и заполнит nspd_quarter_dumps мусором.
#
# Task code остаётся в tasks/nspd_sync.py — re-enable после Sprint 2 grid
# sampling rewrite (см. Bug_NSPD_WMS_NotBulk_2026_May14 → Sprint 2 fix-strategy).
# До тех пор harvest_quarter можно вызывать вручную через admin endpoint.
#
# schedule["nspd-harvest-stale-quarters"] = {
# "task": "tasks.nspd_sync.harvest_stale_quarters",
# "schedule": _parse_cron("0 4 * * mon"),
# "kwargs": {"region_code": 66, "max_age_days": 90, "batch_size": 50},
# "options": {"queue": "celery"},
# }
# Schedule: Mon 04:00 МСК (01:00 UTC). batch_size=50 ограничивает fanout per
# tick — при 11k+ кварталов в cad_quarters_geom полный backfill займёт
# несколько недель, но защищает от WAF rate-limit burst.
# max_age_days=90 — refresh свежее квартала; новые / отсутствующие dumps
# тоже попадают через harvest_stale_quarters (берёт NULL fetched_at).
schedule["nspd-harvest-stale-quarters"] = {
"task": "tasks.nspd_sync.harvest_stale_quarters",
"schedule": _parse_cron("0 1 * * mon"), # 01:00 UTC = 04:00 МСК
"kwargs": {"region_code": 66, "max_age_days": 90, "batch_size": 50},
"options": {"queue": "celery"},
}
return schedule