From d0bdb7ea3f381a536ea3226ac28c485a3ae3fd46 Mon Sep 17 00:00:00 2001 From: Lonami Exo Date: Wed, 7 Mar 2018 11:13:55 +0100 Subject: [PATCH] Lower message severity when retrying invoke the first time --- telethon/telegram_bare_client.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/telethon/telegram_bare_client.py b/telethon/telegram_bare_client.py index bf33a7dc..7164bb17 100644 --- a/telethon/telegram_bare_client.py +++ b/telethon/telegram_bare_client.py @@ -450,9 +450,10 @@ class TelegramBareClient: if result is not None: return result - __log__.warning('Invoking %s failed %d times, ' - 'reconnecting and retrying', - [str(x) for x in requests], retry + 1) + log = __log__.info if retry == 0 else __log__.warning + log('Invoking %s failed %d times, connecting again and retrying', + [str(x) for x in requests], retry + 1) + sleep(1) # The ReadThread has priority when attempting reconnection, # since this thread is constantly running while __call__ is