feat(fulfillment): 增加账号商品能力索引与生命周期事件
This commit is contained in:
@@ -290,6 +290,24 @@ def on_ck_verdict(
|
||||
# `error`(查不到)**不**作废:查不到不等于账号出问题了。
|
||||
if verdict == "invalid":
|
||||
invalidate_high_value(account)
|
||||
if account.id is not None:
|
||||
from .account_capability_service import (
|
||||
invalidate_account_commodity_states,
|
||||
)
|
||||
|
||||
try:
|
||||
invalidate_account_commodity_states(
|
||||
db,
|
||||
account_id=int(account.id),
|
||||
reason="CK 已失效,账号商品能力待重新确认",
|
||||
observed_at=now,
|
||||
)
|
||||
except Exception as exc: # noqa: BLE001 - 生命周期主流程不能被派生索引拖垮
|
||||
logger.warning(
|
||||
"作废账号商品能力失败 account_id={}: {}",
|
||||
account.id,
|
||||
exc,
|
||||
)
|
||||
data = detail or {}
|
||||
account.ck_check_result = {
|
||||
"fish_ball": data.get("fish_ball"),
|
||||
|
||||
Reference in New Issue
Block a user