Skip to content

Commit 72b7a53

Browse files
committed
Log to warning only in the last attempt
1 parent 0302a27 commit 72b7a53

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pyrogram/session/session.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -439,9 +439,9 @@ def send(self, data: TLObject, retries: int = MAX_RETRIES, timeout: float = WAIT
439439
if retries == 0:
440440
raise e from None
441441

442-
(log.warning if retries < 3 else log.info)(
442+
(log.warning if retries < 2 else log.info)(
443443
"{}: {} Retrying {}".format(
444-
Session.MAX_RETRIES - retries,
444+
Session.MAX_RETRIES - retries + 1,
445445
datetime.now(), type(data)))
446446

447447
time.sleep(0.5)

0 commit comments

Comments
 (0)