feat: 维护中国代理池并支持账号自动均匀使用
This commit is contained in:
@@ -64,13 +64,19 @@ async def lifespan(_app: FastAPI):
|
||||
load_admin_identity()
|
||||
stop_refresh = None
|
||||
study_worker = None
|
||||
stop_pool = None
|
||||
if os.environ.get("EUNIV_DISABLE_REFRESH") != "1":
|
||||
stop_refresh = start_credential_refresh()
|
||||
from euniv.autostudy import start_autostudy
|
||||
from euniv.proxy_pool import start_proxy_pool
|
||||
|
||||
study_worker = start_autostudy()
|
||||
stop_pool = start_proxy_pool()
|
||||
yield
|
||||
if study_worker is not None:
|
||||
study_worker.stop()
|
||||
if stop_pool is not None:
|
||||
stop_pool.set()
|
||||
if stop_refresh is not None:
|
||||
stop_refresh.set()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user