perf(douyu): 拆分任务槽并改造绑定扫码调度

This commit is contained in:
yml
2026-11-20 22:03:20 +08:00
parent 8869e427d2
commit 071d45ad1d
40 changed files with 1635 additions and 245 deletions
+3 -2
View File
@@ -5,6 +5,7 @@ from fastapi import APIRouter, Response
from core.huya.cookie_utils import cookie_value
from core.huya.http_client import HuyaHttpClient
from ...database import WorkerSessionLocal
from ...schemas import HuyaWorkbenchTransferToCollab
from ...services.huya_points_center import (
fetch_points_center_catalog,
@@ -339,7 +340,7 @@ async def create_task_batch(
log_queue = asyncio.Queue()
loop = asyncio.get_running_loop()
thread_db = SessionLocal()
thread_db = WorkerSessionLocal()
runner = HuyaBatchRunner(
db=thread_db,
batch_id=batch_id,
@@ -494,7 +495,7 @@ async def ws_huya_logs(websocket: WebSocket, batch_id: str):
if not _has_huya_perm(user, "huya:task"):
await websocket.close(code=1008, reason="无权限")
return
db = SessionLocal()
db = WorkerSessionLocal()
try:
_require_huya_batch_owner(db, user, batch_id)
except HTTPException: