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
+35 -1
View File
@@ -2039,6 +2039,18 @@ class AccountEvent(Base):
# 「某个客服这段时间做了什么」——池化后客服不再持有账号,
# 这条是管理侧追责与对账的主查询路径,此前没有任何索引可用。
Index("ix_account_events_actor_occurred", "actor_id", "occurred_at"),
Index(
"ix_account_events_event_subject_occurred",
"event_type",
"subject_type",
"subject_key",
"occurred_at",
),
Index(
"ix_account_events_type_occurred",
"event_type",
"occurred_at",
),
)
@@ -2197,6 +2209,16 @@ class AccountCommodityState(Base):
"account_eligibility",
"valid_until",
),
Index(
"ix_account_commodity_skin_options",
"platform",
"account_eligibility",
"offer_state",
"valid_until",
"scope",
"commodity_id",
"commodity_name",
),
)
@@ -2493,6 +2515,11 @@ class PlatformFulfillmentTask(Base):
customer_role_name: Mapped[str] = mapped_column(
String(128), nullable=False, default="", server_default=""
)
customer_role_norm: Mapped[str | None] = mapped_column(
String(128),
Computed("lower(trim(customer_role_name))", persisted=False),
nullable=True,
)
customer_platform: Mapped[str] = mapped_column(
String(16), nullable=False, default="", server_default=""
)
@@ -2581,6 +2608,12 @@ class PlatformFulfillmentTask(Base):
"next_allocate_at",
"id",
),
Index(
"ix_platform_fulfillment_role_norm",
"flow_version",
"customer_role_norm",
"execution_status",
),
)
@@ -2739,10 +2772,11 @@ class AccountSyncRun(Base):
"started_at",
),
Index(
"ix_account_sync_runs_started_domain_status",
"ix_account_sync_runs_trend_cover",
"started_at",
"domain",
"status",
"duration_ms",
),
)