mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-02-05 14:10:56 +03:00
Fix timeout not accepting timedelta
This commit is contained in:
parent
dedbf29ca4
commit
aa3f26263c
|
@ -65,11 +65,11 @@ class TelegramBaseClient(abc.ABC):
|
||||||
A tuple consisting of ``(socks.SOCKS5, 'host', port)``.
|
A tuple consisting of ``(socks.SOCKS5, 'host', port)``.
|
||||||
See https://github.com/Anorov/PySocks#usage-1 for more.
|
See https://github.com/Anorov/PySocks#usage-1 for more.
|
||||||
|
|
||||||
timeout (`int` | `float` | `timedelta`, optional):
|
timeout (`int` | `float`, optional):
|
||||||
The timeout to be used when connecting, sending and receiving
|
The timeout in seconds to be used when connecting.
|
||||||
responses from the network. This is **not** the timeout to
|
This is **not** the timeout to be used when ``await``'ing for
|
||||||
be used when ``await``'ing for invoked requests, and you
|
invoked requests, and you should use ``asyncio.wait`` or
|
||||||
should use ``asyncio.wait`` or ``asyncio.wait_for`` for that.
|
``asyncio.wait_for`` for that.
|
||||||
|
|
||||||
request_retries (`int`, optional):
|
request_retries (`int`, optional):
|
||||||
How many times a request should be retried. Request are retried
|
How many times a request should be retried. Request are retried
|
||||||
|
@ -147,7 +147,7 @@ class TelegramBaseClient(abc.ABC):
|
||||||
connection=ConnectionTcpFull,
|
connection=ConnectionTcpFull,
|
||||||
use_ipv6=False,
|
use_ipv6=False,
|
||||||
proxy=None,
|
proxy=None,
|
||||||
timeout=timedelta(seconds=10),
|
timeout=10,
|
||||||
request_retries=5,
|
request_retries=5,
|
||||||
connection_retries=5,
|
connection_retries=5,
|
||||||
auto_reconnect=True,
|
auto_reconnect=True,
|
||||||
|
@ -248,10 +248,6 @@ class TelegramBaseClient(abc.ABC):
|
||||||
# Save whether the user is authorized here (a.k.a. logged in)
|
# Save whether the user is authorized here (a.k.a. logged in)
|
||||||
self._authorized = None # None = We don't know yet
|
self._authorized = None # None = We don't know yet
|
||||||
|
|
||||||
# Default PingRequest delay
|
|
||||||
self._last_ping = datetime.now()
|
|
||||||
self._ping_delay = timedelta(minutes=1)
|
|
||||||
|
|
||||||
self._updates_handle = None
|
self._updates_handle = None
|
||||||
self._last_request = time.time()
|
self._last_request = time.time()
|
||||||
self._channel_pts = {}
|
self._channel_pts = {}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user