mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
feat(timeout):
implement (class-bound, instance-bound, request-bound) session timeout for requests. fix docs config, fix aiohttp session docs links.
This commit is contained in:
parent
2adc19724d
commit
df4ba87dfc
6 changed files with 55 additions and 16 deletions
|
|
@ -13,7 +13,6 @@ if TYPE_CHECKING: # pragma: no cover
|
|||
from ..client.bot import Bot
|
||||
|
||||
T = TypeVar("T")
|
||||
DEFAULT_REQUEST_TIMEOUT_SECONDS = 60.0
|
||||
|
||||
|
||||
class Request(BaseModel):
|
||||
|
|
@ -56,7 +55,7 @@ class TelegramMethod(abc.ABC, BaseModel, Generic[T]):
|
|||
def build_request(self) -> Request: # pragma: no cover
|
||||
pass
|
||||
|
||||
request_timeout: float = DEFAULT_REQUEST_TIMEOUT_SECONDS
|
||||
request_timeout: Optional[float] = None
|
||||
|
||||
def dict(self, **kwargs: Any) -> Any:
|
||||
# override dict of pydantic.BaseModel to overcome exporting request_timeout field
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue