fix(deploy): 优化大表迁移并修复后台事件循环

This commit is contained in:
yml
2026-11-20 22:11:54 +08:00
parent 071d45ad1d
commit 409e22be90
7 changed files with 28 additions and 5 deletions
@@ -79,7 +79,7 @@ def upgrade() -> None:
"AND platform_task_id IS NOT NULL "
"AND status IN ('planned', 'pending', 'running') "
"THEN CONCAT('bind:', platform_task_id) ELSE NULL END",
persisted=True,
persisted=False,
),
nullable=True,
),
+1 -1
View File
@@ -390,7 +390,7 @@ class DouyuTask(Base):
"AND platform_task_id IS NOT NULL "
"AND status IN ('planned', 'pending', 'running') "
"THEN CONCAT('bind:', platform_task_id) ELSE NULL END",
persisted=True,
persisted=False,
),
nullable=True,
)
+2 -1
View File
@@ -38,9 +38,10 @@ def start_douyu_batch(
concurrency: int,
loop: asyncio.AbstractEventLoop | None = None,
log_queue: asyncio.Queue | None = None,
capture_event_loop: bool = True,
) -> None:
"""Create the batch coordinator; websocket logging is optional."""
if loop is None:
if loop is None and capture_event_loop:
try:
loop = asyncio.get_running_loop()
except RuntimeError:
@@ -2052,6 +2052,7 @@ async def start_binding(
task_type="get_bind_qr",
payload={},
concurrency=1,
capture_event_loop=False,
)
return get_task_detail(db, task.id)
@@ -2269,6 +2270,7 @@ async def confirm_binding(
task_type="confirm_bind",
payload={},
concurrency=1,
capture_event_loop=False,
)
return get_task_detail(db, task.id)