mirror of
https://github.com/PaiGramTeam/PaiGram.git
synced 2024-11-16 04:35:49 +00:00
🎨 Set the timeout for resource downloads to 10 seconds
This commit is contained in:
parent
bd11e7d831
commit
0743367a7f
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user