bug: swap to asyncio.read() in base RPC to try to handle possible missed messages.
This commit is contained in:
@@ -233,14 +233,7 @@ If you are sure you want to use this command please use API.send_command("{comma
|
|||||||
# loop to receive all the data
|
# loop to receive all the data
|
||||||
logging.debug(f"{self} - ([Hidden] Send Bytes) - Receiving")
|
logging.debug(f"{self} - ([Hidden] Send Bytes) - Receiving")
|
||||||
try:
|
try:
|
||||||
while True:
|
ret_data = await asyncio.wait_for(reader.read(), timeout=timeout)
|
||||||
try:
|
|
||||||
d = await asyncio.wait_for(reader.read(4096), timeout=timeout)
|
|
||||||
if not d:
|
|
||||||
break
|
|
||||||
ret_data += d
|
|
||||||
except (asyncio.CancelledError, asyncio.TimeoutError) as e:
|
|
||||||
raise e
|
|
||||||
except (asyncio.CancelledError, asyncio.TimeoutError) as e:
|
except (asyncio.CancelledError, asyncio.TimeoutError) as e:
|
||||||
raise e
|
raise e
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|||||||
Reference in New Issue
Block a user