fix(douyu): 修复斗鱼链路 P0/P1 隐患并增强 P2 运维队列可观测性

This commit is contained in:
yml
2026-11-29 14:10:24 +08:00
parent be7146a9ef
commit d12d9e02b3
51 changed files with 2510 additions and 561 deletions
@@ -276,6 +276,7 @@ def refresh_activity_goods(
)
if account is None:
raise CollabError("没有带 CK 的斗鱼账号,无法刷新活动商品", code="no_account")
owns_client = client is None
active_client = client or _client_for_account(account)
config_info = config_mapping(config)
db.expunge(account)
@@ -316,6 +317,11 @@ def refresh_activity_goods(
)
db.commit()
raise
finally:
if owns_client:
close = getattr(active_client, "close", None)
if callable(close):
close()
upsert_goods_snapshot(db, goods, commit=False)
record_account_query(
db,