mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-21 17:06:36 +03:00
MTProtoSender: Dont try to reconnenct in background when auto_reconnect flag is not active
This commit is contained in:
parent
d3a201a277
commit
0868e05528
|
@ -416,6 +416,8 @@ class MTProtoSender:
|
|||
|
||||
def _start_reconnect(self, error):
|
||||
"""Starts a reconnection in the background."""
|
||||
if not self._auto_reconnect and error is not None:
|
||||
raise error
|
||||
if self._user_connected and not self._reconnecting:
|
||||
# We set reconnecting to True here and not inside the new task
|
||||
# because it may happen that send/recv loop calls this again
|
||||
|
|
Loading…
Reference in New Issue
Block a user