Reconnect if invoking failed (#270)

This commit is contained in:
Lonami Exo 2017-11-12 16:25:56 +01:00
parent 5a57a8a498
commit 99512875a2

View File

@ -428,7 +428,10 @@ class TelegramBareClient:
result = self._invoke( result = self._invoke(
sender, call_receive, update_state, *requests sender, call_receive, update_state, *requests
) )
if result is not None: if result is None:
sleep(1)
self._reconnect()
else:
return result return result
raise ValueError('Number of retries reached 0.') raise ValueError('Number of retries reached 0.')