refactor: 自动学习改为 asyncio 并发架构,支持多用户并行和 proxy 预留
This commit is contained in:
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user