diff --git a/cfg_util/func/__init__.py b/cfg_util/func/__init__.py index fada27ce..0bba48f0 100644 --- a/cfg_util/func/__init__.py +++ b/cfg_util/func/__init__.py @@ -16,7 +16,7 @@ from config.bos import bos_config_convert, general_config_convert_bos 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): if append: @@ -101,11 +101,12 @@ async def send_config(ips: list, config): miners = await asyncio.gather(*tasks) tasks = [] for miner in miners: - if len(tasks) < GET_VERSION_THREADS: + if len(tasks) < CONFIG_THREADS: tasks.append(miner.send_config(config)) else: await asyncio.gather(*tasks) tasks = [] + await asyncio.gather(*tasks) await update_ui_with_data("status", "") diff --git a/network/__init__.py b/network/__init__.py index 3fe4f7bf..c40f6fe2 100644 --- a/network/__init__.py +++ b/network/__init__.py @@ -39,6 +39,7 @@ class MinerNetwork: miner_ips_scan = await asyncio.gather(*scan_tasks) miner_ips.extend(miner_ips_scan) scan_tasks = [] + await asyncio.gather(*scan_tasks) miner_ips = list(filter(None, miner_ips)) print(f"Found {len(miner_ips)} connected miners...") create_miners_tasks = [] diff --git a/settings.py b/settings.py index 849c37f2..0d0aee73 100644 --- a/settings.py +++ b/settings.py @@ -1,7 +1,7 @@ NETWORK_PING_RETRIES: int = 3 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