🎨 Set the timeout for resource downloads to 10 seconds

This commit is contained in:
洛水居室 2023-03-14 14:17:19 +08:00
parent bd11e7d831
commit 0743367a7f
No known key found for this signature in database
GPG Key ID: C9DE87DA724B88FC

View File

@ -126,7 +126,7 @@ class PluginFuncs:
file_path = CACHE_DIR.joinpath(file_name)
if not file_path.exists(): # 若文件不存在,则下载
async with httpx.AsyncClient(headers=REQUEST_HEADERS) as client:
async with httpx.AsyncClient(headers=REQUEST_HEADERS, timeout=10) as client:
try:
response = await client.get(url)
except UnsupportedProtocol: