fixed a bug with timeouts on get version
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
from cfg_util import main
|
from cfg_util import main
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
main()
|
main()
|
||||||
|
|||||||
@@ -43,7 +43,10 @@ class MinerFactory:
|
|||||||
# open a connection to the miner
|
# open a connection to the miner
|
||||||
fut = asyncio.open_connection(str(ip), 4028)
|
fut = asyncio.open_connection(str(ip), 4028)
|
||||||
# get reader and writer streams
|
# get reader and writer streams
|
||||||
reader, writer = await asyncio.wait_for(fut, timeout=5)
|
try:
|
||||||
|
reader, writer = await asyncio.wait_for(fut, timeout=7)
|
||||||
|
except asyncio.exceptions.TimeoutError:
|
||||||
|
return None
|
||||||
|
|
||||||
# create the command
|
# create the command
|
||||||
cmd = {"command": "version"}
|
cmd = {"command": "version"}
|
||||||
@@ -68,7 +71,10 @@ class MinerFactory:
|
|||||||
# some stupid whatsminers need a different command
|
# some stupid whatsminers need a different command
|
||||||
fut = asyncio.open_connection(str(ip), 4028)
|
fut = asyncio.open_connection(str(ip), 4028)
|
||||||
# get reader and writer streams
|
# get reader and writer streams
|
||||||
reader, writer = await asyncio.wait_for(fut, timeout=5)
|
try:
|
||||||
|
reader, writer = await asyncio.wait_for(fut, timeout=7)
|
||||||
|
except asyncio.exceptions.TimeoutError:
|
||||||
|
return None
|
||||||
|
|
||||||
# create the command
|
# create the command
|
||||||
cmd = {"command": "get_version"}
|
cmd = {"command": "get_version"}
|
||||||
|
|||||||
Reference in New Issue
Block a user