Skip to content

Commit 4b91466

Browse files
committed
Log the reason why a query ought to be re-tried
1 parent 7a2bddc commit 4b91466

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

pyrogram/session/session.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,10 @@
2626
from queue import Queue
2727
from threading import Event, Thread
2828

29-
from pyrogram.api.all import layer
30-
3129
import pyrogram
3230
from pyrogram import __copyright__, __license__, __version__
3331
from pyrogram.api import functions, types, core
32+
from pyrogram.api.all import layer
3433
from pyrogram.api.core import Message, TLObject, MsgContainer, Long, FutureSalt, Int
3534
from pyrogram.connection import Connection
3635
from pyrogram.crypto import AES, KDF
@@ -440,9 +439,9 @@ def send(self, data: TLObject, retries: int = MAX_RETRIES, timeout: float = WAIT
440439
raise e from None
441440

442441
(log.warning if retries < 2 else log.info)(
443-
"{}: {} Retrying {}".format(
442+
"[{}] Retrying {} due to {}".format(
444443
Session.MAX_RETRIES - retries + 1,
445-
datetime.now(), type(data)))
444+
data.QUALNAME, e))
446445

447446
time.sleep(0.5)
448447
return self.send(data, retries - 1, timeout)

0 commit comments

Comments
 (0)