Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

MTProtoSender: Dont try to reconnenct in background when auto_reconnect is not available #4350

Open
wants to merge 1 commit into
base: v1
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions telethon/network/mtprotosender.py
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,8 @@ async def _reconnect(self, last_error):

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
Expand Down