bug: swap to asyncio.read() in base RPC to try to handle possible missed messages.

This commit is contained in:
b-rowan
2024-02-03 00:35:41 -07:00
parent 4c45d356c4
commit 8a64ff3559

View File

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