fix(freshness): пороги nspd_geo под on-demand каденцию (убирает еженедельный ложный stale) #2325

Merged
bot-backend merged 2 commits from fix/nspd-geo-freshness-threshold into main 2026-07-03 21:46:31 +00:00
Showing only changes of commit 7af29f23ed - Show all commits

View file

@ -89,8 +89,8 @@ def test_freshness_mixed_statuses() -> None:
"last_status": None,
},
"nspd_geo_jobs": {
"last_success_at": _ago(40.0), # >= stale_days=30 → critical → failed
"last_attempt_at": _ago(40.0),
"last_success_at": _ago(100.0), # >= stale_days=90 → critical → failed
"last_attempt_at": _ago(100.0),
"upd_24h": 0,
"upd_7d": 0,
"last_status": "done",
@ -230,9 +230,7 @@ def test_freshness_all_healthy() -> None:
"last_status": "done",
"recent_output": 100000, # выше любого floor → flagged-источники ok
}
rows = {
s.table: dict(fresh_row) for s in admin_scrape._FRESHNESS_SOURCES
}
rows = {s.table: dict(fresh_row) for s in admin_scrape._FRESHNESS_SOURCES}
_override_db(_make_db(rows))
try:
resp = TestClient(app).get(ENDPOINT)