From 4b914662ef4a67580beb5d5c03e1e57e95e2cab6 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Tue, 13 Aug 2019 13:20:21 +0200 Subject: [PATCH] Log the reason why a query ought to be re-tried --- pyrogram/session/session.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pyrogram/session/session.py b/pyrogram/session/session.py index 689fe584..673bbcc9 100644 --- a/pyrogram/session/session.py +++ b/pyrogram/session/session.py @@ -26,11 +26,10 @@ from os import urandom from queue import Queue from threading import Event, Thread -from pyrogram.api.all import layer - import pyrogram from pyrogram import __copyright__, __license__, __version__ from pyrogram.api import functions, types, core +from pyrogram.api.all import layer from pyrogram.api.core import Message, TLObject, MsgContainer, Long, FutureSalt, Int from pyrogram.connection import Connection from pyrogram.crypto import AES, KDF @@ -440,9 +439,9 @@ class Session: raise e from None (log.warning if retries < 2 else log.info)( - "{}: {} Retrying {}".format( + "[{}] Retrying {} due to {}".format( Session.MAX_RETRIES - retries + 1, - datetime.now(), type(data))) + data.QUALNAME, e)) time.sleep(0.5) return self.send(data, retries - 1, timeout)