feat: 采集任务在有效账号之间按负载分摊

This commit is contained in:
2026-11-10 11:34:29 +08:00
parent 8f92e5aa36
commit 9309d25420
7 changed files with 112 additions and 8 deletions
+5
View File
@@ -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()