feat: 自动代理改为向接口领取,去掉 ProxyHub 和代理列表
This commit is contained in:
@@ -97,7 +97,7 @@ async def lifespan(_app: FastAPI):
|
||||
|
||||
acquire_instance_lock()
|
||||
if os.environ.get("EUNIV_DISABLE_REFRESH") == "1":
|
||||
logging.getLogger("euniv.api").warning("EUNIV_DISABLE_REFRESH=1,后台刷新、自动学习和代理池都不会启动")
|
||||
logging.getLogger("euniv.api").warning("EUNIV_DISABLE_REFRESH=1,后台刷新和自动学习都不会启动")
|
||||
init_db()
|
||||
ensure_admin_seed()
|
||||
from admin.settings import ensure_key_check
|
||||
@@ -109,20 +109,15 @@ async def lifespan(_app: FastAPI):
|
||||
attach_loop(asyncio.get_running_loop())
|
||||
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()
|
||||
start_pending_cleaner()
|
||||
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