bug: fix a bug with connection errors rarely being raised on read in API commands.
This commit is contained in:
@@ -182,7 +182,10 @@ If you are sure you want to use this command please use API.send_command("{comma
|
|||||||
writer.write(data)
|
writer.write(data)
|
||||||
logging.debug(f"{self} - ([Hidden] Send Bytes) - Draining")
|
logging.debug(f"{self} - ([Hidden] Send Bytes) - Draining")
|
||||||
await writer.drain()
|
await writer.drain()
|
||||||
|
try:
|
||||||
ret_data = await asyncio.wait_for(reader.read(4096), timeout=timeout)
|
ret_data = await asyncio.wait_for(reader.read(4096), timeout=timeout)
|
||||||
|
except ConnectionAbortedError:
|
||||||
|
return b"{}"
|
||||||
try:
|
try:
|
||||||
# Fix for stupid whatsminer bug, reboot/restart seem to not load properly in the loop
|
# Fix for stupid whatsminer bug, reboot/restart seem to not load properly in the loop
|
||||||
# have to receive, save the data, check if there is more data by reading with a short timeout
|
# have to receive, save the data, check if there is more data by reading with a short timeout
|
||||||
|
|||||||
Reference in New Issue
Block a user