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 55c09cde97
commit 6cd96389c0

View File

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