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
+3 -1
View File
@@ -45,7 +45,7 @@ TESTS_DIR = Path(__file__).resolve().parent
PROJECT_ROOT = TESTS_DIR.parent
VERSIONS_DIR = PROJECT_ROOT / "web" / "backend" / "migrations" / "versions"
HEAD_REVISION = "20261129_0140"
HEAD_REVISION = "20261129_0141"
# 迁移新增、但不声明在模型里的复合查询索引。
EXTRA_INDEXES = (
@@ -91,6 +91,7 @@ _LATER_ORM_COLUMNS = {
"exchange_result_image_key": "VARCHAR(512) NOT NULL DEFAULT ''",
"exchange_result_image_saved_at": "DATETIME NULL",
"customer_role_name": "VARCHAR(128) NOT NULL DEFAULT ''",
"customer_role_norm": "VARCHAR(128) GENERATED ALWAYS AS (lower(trim(customer_role_name))) VIRTUAL NULL",
"customer_platform": "VARCHAR(16) NOT NULL DEFAULT ''",
"customer_system": "VARCHAR(16) NOT NULL DEFAULT ''",
"customer_home_images": "JSON NULL",
@@ -248,6 +249,7 @@ class TestMigrationSmoke:
# 迁移新增的复合查询索引(不入模型,但应存在)。
for index_name in EXTRA_INDEXES:
assert index_name in all_db_indexes, f"迁移链未创建索引 {index_name}"
assert "ix_account_sync_runs_started_domain_status" not in all_db_indexes
finally:
database_module.DATABASE_URL = original_url
with admin_engine.begin() as conn: