mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-03-10 06:05:47 +03:00
Remove unused timeout variable from the TelegramClient
This commit is contained in:
parent
30ac6789ce
commit
ffaa3ac064
|
@ -726,7 +726,6 @@ class TelegramBareClient:
|
||||||
|
|
||||||
async def _recv_loop_impl(self):
|
async def _recv_loop_impl(self):
|
||||||
need_reconnect = False
|
need_reconnect = False
|
||||||
timeout = 1
|
|
||||||
while self._user_connected:
|
while self._user_connected:
|
||||||
try:
|
try:
|
||||||
if need_reconnect:
|
if need_reconnect:
|
||||||
|
@ -741,8 +740,7 @@ class TelegramBareClient:
|
||||||
except ConnectionError as error:
|
except ConnectionError as error:
|
||||||
self._logger.debug(error)
|
self._logger.debug(error)
|
||||||
need_reconnect = True
|
need_reconnect = True
|
||||||
await asyncio.sleep(min(timeout, 15), loop=self._loop)
|
await asyncio.sleep(1, loop=self._loop)
|
||||||
timeout *= 2
|
|
||||||
except Exception as error:
|
except Exception as error:
|
||||||
# Unknown exception, pass it to the main thread
|
# Unknown exception, pass it to the main thread
|
||||||
self._logger.debug(
|
self._logger.debug(
|
||||||
|
@ -769,7 +767,6 @@ class TelegramBareClient:
|
||||||
# add a little sleep to avoid the CPU usage going mad.
|
# add a little sleep to avoid the CPU usage going mad.
|
||||||
await asyncio.sleep(0.1, loop=self._loop)
|
await asyncio.sleep(0.1, loop=self._loop)
|
||||||
break
|
break
|
||||||
timeout = 1
|
|
||||||
self._recv_loop = None
|
self._recv_loop = None
|
||||||
|
|
||||||
# endregion
|
# endregion
|
||||||
|
|
Loading…
Reference in New Issue
Block a user