perf(douyu): 拆分任务槽并改造绑定扫码调度
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user