fixed asyncio scoket bug in main
This commit is contained in:
5
main.py
5
main.py
@@ -3,8 +3,13 @@ from miners.bosminer import BOSminer
|
|||||||
import asyncio
|
import asyncio
|
||||||
from API.bosminer import BOSMinerAPI
|
from API.bosminer import BOSMinerAPI
|
||||||
from API.cgminer import CGMinerAPI
|
from API.cgminer import CGMinerAPI
|
||||||
|
import sys
|
||||||
|
|
||||||
|
|
||||||
|
# Fix bug with some whatsminers and asyncio because of a socket not being shut down:
|
||||||
|
if sys.version_info[0] == 3 and sys.version_info[1] >= 8 and sys.platform.startswith('win'):
|
||||||
|
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
|
||||||
|
|
||||||
async def good_boards():
|
async def good_boards():
|
||||||
miner_network = MinerNetwork('192.168.1.1')
|
miner_network = MinerNetwork('192.168.1.1')
|
||||||
miners = await miner_network.scan_network_for_miners()
|
miners = await miner_network.scan_network_for_miners()
|
||||||
|
|||||||
Reference in New Issue
Block a user