mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-27 03:43:45 +03:00
Fix reconnect always returning False -> infinite loop
This commit is contained in:
parent
4d5f16f2aa
commit
d8bf8bb2eb
|
@ -195,7 +195,9 @@ class TelegramBareClient:
|
||||||
with self._connect_lock:
|
with self._connect_lock:
|
||||||
# Another thread may have connected again, so check that first
|
# Another thread may have connected again, so check that first
|
||||||
if not self.is_connected():
|
if not self.is_connected():
|
||||||
self.connect()
|
return self.connect()
|
||||||
|
else:
|
||||||
|
return True
|
||||||
else:
|
else:
|
||||||
self.disconnect()
|
self.disconnect()
|
||||||
self.session.auth_key = None # Force creating new auth_key
|
self.session.auth_key = None # Force creating new auth_key
|
||||||
|
@ -204,7 +206,7 @@ class TelegramBareClient:
|
||||||
self._sender.connection.ip = self.session.server_address = ip
|
self._sender.connection.ip = self.session.server_address = ip
|
||||||
self._sender.connection.port = self.session.port = dc.port
|
self._sender.connection.port = self.session.port = dc.port
|
||||||
self.session.save()
|
self.session.save()
|
||||||
self.connect()
|
return self.connect()
|
||||||
|
|
||||||
# endregion
|
# endregion
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user