Call disconnect on ConnectionResetError hoping a reconnection

Maybe self._reconnect() had no effect unless a clean disconnect
was done, and so retrying would be mostly useless. Just a guess.
This commit is contained in:
Lonami Exo 2018-05-06 18:59:53 +02:00
parent c0b61f3a63
commit cd410d7fd7

View File

@ -519,6 +519,11 @@ class TelegramBareClient:
__log__.warning('Connection was reset while invoking') __log__.warning('Connection was reset while invoking')
if self._user_connected: if self._user_connected:
# Server disconnected us, __call__ will try reconnecting. # Server disconnected us, __call__ will try reconnecting.
try:
self._sender.disconnect()
except:
pass
return None return None
else: else:
# User never called .connect(), so raise this error. # User never called .connect(), so raise this error.