mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-02-17 03:51:05 +03:00
Except ConnectionResetError on ._reconnect (fix #309)
This commit is contained in:
parent
e2ac18b7bc
commit
db623e37fd
|
@ -297,10 +297,13 @@ class TelegramBareClient:
|
||||||
# Assume we are disconnected due to some error, so connect again
|
# Assume we are disconnected due to some error, so connect again
|
||||||
with self._reconnect_lock:
|
with self._reconnect_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 self.is_connected():
|
||||||
return self.connect()
|
|
||||||
else:
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
try:
|
||||||
|
return self.connect()
|
||||||
|
except ConnectionResetError:
|
||||||
|
return False
|
||||||
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
|
||||||
|
|
Loading…
Reference in New Issue
Block a user