fixed some bugs with the new "threaded" approach
This commit is contained in:
@@ -16,7 +16,7 @@ from config.bos import bos_config_convert, general_config_convert_bos
|
|||||||
|
|
||||||
from API import APIError
|
from API import APIError
|
||||||
|
|
||||||
from settings import CFG_UTIL_GET_VERSION_THREADS as GET_VERSION_THREADS
|
from settings import CFG_UTIL_CONFIG_THREADS as CONFIG_THREADS
|
||||||
|
|
||||||
async def update_ui_with_data(key, data, append=False):
|
async def update_ui_with_data(key, data, append=False):
|
||||||
if append:
|
if append:
|
||||||
@@ -101,11 +101,12 @@ async def send_config(ips: list, config):
|
|||||||
miners = await asyncio.gather(*tasks)
|
miners = await asyncio.gather(*tasks)
|
||||||
tasks = []
|
tasks = []
|
||||||
for miner in miners:
|
for miner in miners:
|
||||||
if len(tasks) < GET_VERSION_THREADS:
|
if len(tasks) < CONFIG_THREADS:
|
||||||
tasks.append(miner.send_config(config))
|
tasks.append(miner.send_config(config))
|
||||||
else:
|
else:
|
||||||
await asyncio.gather(*tasks)
|
await asyncio.gather(*tasks)
|
||||||
tasks = []
|
tasks = []
|
||||||
|
await asyncio.gather(*tasks)
|
||||||
await update_ui_with_data("status", "")
|
await update_ui_with_data("status", "")
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ class MinerNetwork:
|
|||||||
miner_ips_scan = await asyncio.gather(*scan_tasks)
|
miner_ips_scan = await asyncio.gather(*scan_tasks)
|
||||||
miner_ips.extend(miner_ips_scan)
|
miner_ips.extend(miner_ips_scan)
|
||||||
scan_tasks = []
|
scan_tasks = []
|
||||||
|
await asyncio.gather(*scan_tasks)
|
||||||
miner_ips = list(filter(None, miner_ips))
|
miner_ips = list(filter(None, miner_ips))
|
||||||
print(f"Found {len(miner_ips)} connected miners...")
|
print(f"Found {len(miner_ips)} connected miners...")
|
||||||
create_miners_tasks = []
|
create_miners_tasks = []
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
NETWORK_PING_RETRIES: int = 3
|
NETWORK_PING_RETRIES: int = 3
|
||||||
NETWORK_PING_TIMEOUT: int = 5
|
NETWORK_PING_TIMEOUT: int = 5
|
||||||
NETWORK_SCAN_THREADS: int = 100
|
NETWORK_SCAN_THREADS: int = 300
|
||||||
|
|
||||||
CFG_UTIL_GET_VERSION_THREADS: int = 100
|
CFG_UTIL_CONFIG_THREADS: int = 300
|
||||||
|
|
||||||
MINER_FACTORY_GET_VERSION_RETRIES: int = 3
|
MINER_FACTORY_GET_VERSION_RETRIES: int = 3
|
||||||
|
|||||||
Reference in New Issue
Block a user