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:
parent
88e42ecc0d
commit
c05c5c4441
@ -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))
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user