mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-08-05 20:50:22 +03:00
Refactor sender
This commit is contained in:
parent
fb8dbf6fc9
commit
accaf2f9bb
|
@ -246,9 +246,10 @@ async def invoke_request(
|
|||
sleep_thresh = client._config.flood_sleep_threshold
|
||||
rx = client._sender.enqueue(request)
|
||||
while True:
|
||||
await step_sender(client)
|
||||
while not rx.done():
|
||||
await step_sender(client)
|
||||
try:
|
||||
response = await rx
|
||||
response = rx.result()
|
||||
break
|
||||
except RpcError as e:
|
||||
if e.code == 420 and e.value is not None and e.value < sleep_thresh:
|
||||
|
|
Loading…
Reference in New Issue
Block a user