From c05c5c44410cb2188f1189dfdd5e9fa53f7c4676 Mon Sep 17 00:00:00 2001 From: SuperCz1 <62919067+SuperCz1@users.noreply.github.com> Date: Thu, 7 May 2020 11:35:08 +0200 Subject: [PATCH] Add session name in "Sleeping for Xs" log lines (#401) * Update send_media_group.py * Update get_dialogs.py * Update get_dialogs.py * Update get_messages.py * Update get_history.py * Update get_chat_members.py --- pyrogram/client/methods/chats/get_chat_members.py | 2 +- pyrogram/client/methods/chats/get_dialogs.py | 2 +- pyrogram/client/methods/messages/get_history.py | 2 +- pyrogram/client/methods/messages/get_messages.py | 2 +- pyrogram/client/methods/messages/send_media_group.py | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pyrogram/client/methods/chats/get_chat_members.py b/pyrogram/client/methods/chats/get_chat_members.py index a8ae4054..6be3408b 100644 --- a/pyrogram/client/methods/chats/get_chat_members.py +++ b/pyrogram/client/methods/chats/get_chat_members.py @@ -153,7 +153,7 @@ class GetChatMembers(BaseClient): return pyrogram.List(pyrogram.ChatMember._parse(self, member, users) for member in members) except FloodWait as e: - log.warning("Sleeping for {}s".format(e.x)) + log.warning("[{}] Sleeping for {}s".format(self.session_name, e.x)) time.sleep(e.x) else: raise ValueError("The chat_id \"{}\" belongs to a user".format(chat_id)) diff --git a/pyrogram/client/methods/chats/get_dialogs.py b/pyrogram/client/methods/chats/get_dialogs.py index 6234538b..ea2eec63 100644 --- a/pyrogram/client/methods/chats/get_dialogs.py +++ b/pyrogram/client/methods/chats/get_dialogs.py @@ -82,7 +82,7 @@ class GetDialogs(BaseClient): ) ) except FloodWait as e: - log.warning("Sleeping {}s".format(e.x)) + log.warning("[{}] Sleeping for {}s".format(self.session_name, e.x)) time.sleep(e.x) else: break diff --git a/pyrogram/client/methods/messages/get_history.py b/pyrogram/client/methods/messages/get_history.py index bf348ac9..7741340c 100644 --- a/pyrogram/client/methods/messages/get_history.py +++ b/pyrogram/client/methods/messages/get_history.py @@ -103,7 +103,7 @@ class GetHistory(BaseClient): ) ) except FloodWait as e: - log.warning("Sleeping for {}s".format(e.x)) + log.warning("[{}] Sleeping for {}s".format(self.session_name, e.x)) time.sleep(e.x) else: break diff --git a/pyrogram/client/methods/messages/get_messages.py b/pyrogram/client/methods/messages/get_messages.py index a18d84c2..f3e53b94 100644 --- a/pyrogram/client/methods/messages/get_messages.py +++ b/pyrogram/client/methods/messages/get_messages.py @@ -116,7 +116,7 @@ class GetMessages(BaseClient): try: r = self.send(rpc) except FloodWait as e: - log.warning("Sleeping for {}s".format(e.x)) + log.warning("[{}] Sleeping for {}s".format(self.session_name, e.x)) time.sleep(e.x) else: break diff --git a/pyrogram/client/methods/messages/send_media_group.py b/pyrogram/client/methods/messages/send_media_group.py index 055c7b7c..725a8a84 100644 --- a/pyrogram/client/methods/messages/send_media_group.py +++ b/pyrogram/client/methods/messages/send_media_group.py @@ -195,7 +195,7 @@ class SendMediaGroup(BaseClient): ) ) except FloodWait as e: - log.warning("Sleeping for {}s".format(e.x)) + log.warning("[{}] Sleeping for {}s".format(self.session_name, e.x)) time.sleep(e.x) else: break