removed arbitrary scan thread limitation dividing

This commit is contained in:
UpstreamData
2022-07-19 13:01:28 -06:00
parent c5f2d71791
commit a95333eb1c

View File

@@ -97,7 +97,7 @@ class MinerNetwork:
for host in local_network.hosts(): for host in local_network.hosts():
# make sure we don't exceed the allowed async tasks # make sure we don't exceed the allowed async tasks
if len(scan_tasks) < round(PyasicSettings().network_scan_threads / 3): if len(scan_tasks) < round(PyasicSettings().network_scan_threads):
# add the task to the list # add the task to the list
scan_tasks.append(self.ping_and_get_miner(host)) scan_tasks.append(self.ping_and_get_miner(host))
else: else:
@@ -137,7 +137,7 @@ class MinerNetwork:
# for each ip on the network, loop through and scan it # for each ip on the network, loop through and scan it
for host in local_network.hosts(): for host in local_network.hosts():
# make sure we don't exceed the allowed async tasks # make sure we don't exceed the allowed async tasks
if len(scan_tasks) >= round(PyasicSettings().network_scan_threads / 3): if len(scan_tasks) >= round(PyasicSettings().network_scan_threads):
# scanned is a loopable list of awaitables # scanned is a loopable list of awaitables
scanned = asyncio.as_completed(scan_tasks) scanned = asyncio.as_completed(scan_tasks)
# when we scan, empty the scan tasks # when we scan, empty the scan tasks
@@ -171,6 +171,7 @@ class MinerNetwork:
except ConnectionRefusedError: except ConnectionRefusedError:
pass pass
@staticmethod @staticmethod
async def ping_and_get_miner( async def ping_and_get_miner(
ip: ipaddress.ip_address, ip: ipaddress.ip_address,