perf(account-check): 优化账号检测首屏加载

This commit is contained in:
yml
2026-11-22 17:05:10 +08:00
parent 7233bdfa50
commit 22e106bf9b
9 changed files with 421 additions and 150 deletions
+16
View File
@@ -161,6 +161,22 @@ def test_protection_target_reports_ck_health_and_shortage(db):
}
def test_protection_target_counts_missing_cookie_without_full_account_load(db):
account = _account("protection-no-cookie")
account.cookie = ""
db.add(account)
db.flush()
db.add(_presale_task(account))
db.add(_health_job())
db.commit()
rows = evaluate_protection_targets(db, now=NOW)
presale = next(row for row in rows if row["group_key"] == "presale_bound")
assert presale["bound_count"] == 1
assert presale["without_cookie"] == 1
def test_ck_health_probes_protected_account_at_its_shorter_interval_first(db):
protected = _account(
"protection-due",