From 9381824cb278f4749d3ae8863f52e2b142431bf9 Mon Sep 17 00:00:00 2001 From: liuwei Date: Thu, 25 Dec 2025 09:54:46 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=A9=E6=B0=94=E6=8E=A5=E5=8F=A3,=E5=8A=A0?= =?UTF-8?q?=E5=85=A5=E4=B8=AA=E8=B6=85=E6=97=B6.=E7=8E=B0=E5=9C=A8?= =?UTF-8?q?=E5=A5=BD=E5=83=8F=E5=8F=AA=E6=88=90=E5=8A=9F=E4=BA=86=E4=B8=80?= =?UTF-8?q?=E6=AC=A1,=E6=84=9F=E8=A7=89=E6=98=AF=E8=A2=AB=E9=99=90?= =?UTF-8?q?=E5=88=B6=E4=BA=86=E8=B0=83=E7=94=A8=E6=83=85=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/weather/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/weather/main.py b/plugins/weather/main.py index b02b3e4..bc13e29 100644 --- a/plugins/weather/main.py +++ b/plugins/weather/main.py @@ -522,13 +522,13 @@ class WeatherPlugin(MessagePluginInterface): # 获取实时天气 conn = aiohttp.TCPConnector(ssl=False) now_url = f'{self.api_domain}/v7/weather/now?key={self.api_key}&location={city_id}' - async with aiohttp.request('GET', now_url, connector=conn) as resp: + async with aiohttp.request('GET', now_url, connector=conn,timeout=20) as resp: now_json = await resp.json() # 获取预报 conn = aiohttp.TCPConnector(ssl=False) daily_url = f'{self.api_domain}/v7/weather/7d?key={self.api_key}&location={city_id}' - async with aiohttp.request('GET', daily_url, connector=conn) as resp: + async with aiohttp.request('GET', daily_url, connector=conn,timeout=20) as resp: daily_json = await resp.json() if now_json.get('code') != '200' or daily_json.get('code') != '200':