feat: 自动代理改为向接口领取,去掉 ProxyHub 和代理列表

This commit is contained in:
2026-11-17 21:15:41 +08:00
parent 19db13b360
commit 2fc5a0421b
14 changed files with 559 additions and 1743 deletions
+1 -6
View File
@@ -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()