mirror of
https://github.com/nonebot/nonebot2.git
synced 2026-04-19 15:45:43 +00:00
♻️ add default timeout
This commit is contained in:
@@ -46,6 +46,7 @@ from nonebot.internal.driver import (
|
||||
Timeout,
|
||||
TimeoutTypes,
|
||||
)
|
||||
from nonebot.log import logger
|
||||
from nonebot.utils import UNSET, UnsetType, exclude_unset
|
||||
|
||||
try:
|
||||
@@ -328,6 +329,12 @@ class Mixin(HTTPClientMixin, WebSocketClientMixin):
|
||||
if setup.ping_interval is not UNSET:
|
||||
autoping = setup.ping_interval is not None
|
||||
|
||||
if isinstance(setup.timeout, Timeout) and setup.timeout.ping is not UNSET:
|
||||
logger.warning(
|
||||
"aiohttp driver does not expose a separate ping timeout; "
|
||||
"the configured ping timeout will be ignored."
|
||||
)
|
||||
|
||||
async with aiohttp.ClientSession(version=version, trust_env=True) as session:
|
||||
async with session.ws_connect(
|
||||
setup.url,
|
||||
|
||||
Reference in New Issue
Block a user