feat: 采集任务在有效账号之间按负载分摊
This commit is contained in:
@@ -7,6 +7,7 @@ import logging
|
||||
import threading
|
||||
import time
|
||||
|
||||
from app.collect.accounts import reset_active_tasks
|
||||
from app.config import installed
|
||||
from app.db import session_scope
|
||||
from app.tasks.runner import refresh_accounts, scan_sources
|
||||
@@ -20,6 +21,10 @@ def start_background() -> None:
|
||||
if _started:
|
||||
return
|
||||
_started = True
|
||||
try:
|
||||
reset_active_tasks()
|
||||
except Exception as exc:
|
||||
logger.info("重置账号占用未完成: %s", exc)
|
||||
threading.Thread(target=_refresh_loop, name="decom-refresh", daemon=True).start()
|
||||
threading.Thread(target=_collect_loop, name="decom-collect", daemon=True).start()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user