refactor: 自动学习改为 asyncio 并发架构,支持多用户并行和 proxy 预留

This commit is contained in:
2026-11-15 01:05:52 +08:00
parent ffa563d97c
commit 9e85a4184c
2 changed files with 551 additions and 227 deletions
+4 -4
View File
@@ -44,14 +44,14 @@ async def lifespan(_app: FastAPI):
ensure_admin_seed()
load_admin_identity()
stop_refresh = None
stop_study = None
study_worker = None
if os.environ.get("EUNIV_DISABLE_REFRESH") != "1":
stop_refresh = start_credential_refresh()
from euniv.autostudy import start_autostudy
stop_study = start_autostudy()
study_worker = start_autostudy()
yield
if stop_study is not None:
stop_study.stop()
if study_worker is not None:
study_worker.stop()
if stop_refresh is not None:
stop_refresh.set()