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
This commit is contained in:
SuperCz1 2020-05-07 11:35:08 +02:00 committed by GitHub
parent 88e42ecc0d
commit c05c5c4441
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 5 additions and 5 deletions

View File

@ -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))

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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