mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Allow to use zero as request timeout
This commit is contained in:
parent
7844a663a9
commit
4d631a3069
2 changed files with 4 additions and 2 deletions
|
|
@ -278,7 +278,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
:param method:
|
||||
:return:
|
||||
"""
|
||||
return await self.session.make_request(self.__token, method)
|
||||
return await self.session.make_request(self.__token, method, timeout=request_timeout)
|
||||
|
||||
def __hash__(self) -> int:
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -134,7 +134,9 @@ class AiohttpSession(BaseSession):
|
|||
url = self.api.api_url(token=token, method=request.method)
|
||||
form = self.build_form_data(request)
|
||||
|
||||
async with session.post(url, data=form, timeout=timeout or self.timeout) as resp:
|
||||
async with session.post(
|
||||
url, data=form, timeout=self.timeout if timeout is None else timeout
|
||||
) as resp:
|
||||
raw_result = await resp.json(loads=self.json_loads)
|
||||
|
||||
response = call.build_response(raw_result)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue