From 72b7a53ff5b6a12a74bf18859231e3c94c9279fd Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Thu, 25 Jul 2019 11:15:56 +0200 Subject: [PATCH] Log to warning only in the last attempt --- pyrogram/session/session.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyrogram/session/session.py b/pyrogram/session/session.py index 5947fc0f..21e2ba10 100644 --- a/pyrogram/session/session.py +++ b/pyrogram/session/session.py @@ -439,9 +439,9 @@ class Session: if retries == 0: raise e from None - (log.warning if retries < 3 else log.info)( + (log.warning if retries < 2 else log.info)( "{}: {} Retrying {}".format( - Session.MAX_RETRIES - retries, + Session.MAX_RETRIES - retries + 1, datetime.now(), type(data))) time.sleep(0.5)