Refactor sender

This commit is contained in:
Jahongir Qurbonov 2024-10-21 21:06:53 +05:00
parent fb8dbf6fc9
commit accaf2f9bb

View File

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