fix: 尝试修复aiohttp请求时的代理配置 #21

This commit is contained in:
helloplhm-qwq 2024-01-13 01:09:19 +08:00
parent 068dc5ab89
commit 5fb8913704
No known key found for this signature in database
GPG Key ID: B7542212855B2C26
2 changed files with 2 additions and 2 deletions

View File

@ -229,7 +229,7 @@ async def AsyncRequest(url, options = {}):
@ return: common.Httpx.ClientResponse类型的响应数据 @ return: common.Httpx.ClientResponse类型的响应数据
''' '''
if (not variable.aioSession): if (not variable.aioSession):
variable.aioSession = aiohttp.ClientSession() variable.aioSession = aiohttp.ClientSession(trust_env=True)
# 缓存读取 # 缓存读取
cache_key = f'{url}{options}' cache_key = f'{url}{options}'
if (isinstance(options.get('cache-ignore'), list)): if (isinstance(options.get('cache-ignore'), list)):

View File

@ -208,7 +208,7 @@ async def run_app():
async def initMain(): async def initMain():
await scheduler.run() await scheduler.run()
variable.aioSession = aiohttp.ClientSession() variable.aioSession = aiohttp.ClientSession(trust_env=True)
try: try:
await run_app() await run_app()
logger.info("服务器启动成功请按下Ctrl + C停止") logger.info("服务器启动成功请按下Ctrl + C停止")