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
@@ -7,7 +7,7 @@ import threading
from loguru import logger
from ...database import SessionLocal
from ...database import WorkerSessionLocal
_stop_event = threading.Event()
_thread: threading.Thread | None = None
@@ -31,7 +31,7 @@ def _run() -> None:
# 不抢占启动时的 Webhook;首轮延后一分钟。
if _stop_event.wait(min(60, _interval_seconds())):
break
db = SessionLocal()
db = WorkerSessionLocal()
try:
queued = 0
for _page in range(20):