@@ -159,7 +159,7 @@ def __init__(
159159 final_concurrent_server_scans_limit = concurrent_server_scans_limit
160160 self ._concurrent_server_scans_count = final_concurrent_server_scans_limit
161161
162- self ._all_thread_pools : List [ThreadPoolExecutor ] = []
162+ self ._thread_pools : List [ThreadPoolExecutor ] = []
163163 self ._queued_server_scans : List [_QueuedServerScan ] = []
164164
165165 def _get_assigned_thread_pool_index (self ) -> int :
@@ -172,9 +172,9 @@ def _get_assigned_thread_pool_index(self) -> int:
172172 assigned_thread_pool_index = currently_queued_scans_count % allowed_thread_pools_count
173173
174174 try :
175- self ._all_thread_pools [assigned_thread_pool_index ]
175+ self ._thread_pools [assigned_thread_pool_index ]
176176 except IndexError :
177- self ._all_thread_pools .append (ThreadPoolExecutor (max_workers = self ._per_server_concurrent_connections_count ))
177+ self ._thread_pools .append (ThreadPoolExecutor (max_workers = self ._per_server_concurrent_connections_count ))
178178
179179 return assigned_thread_pool_index
180180
@@ -190,7 +190,7 @@ def queue_scan(self, server_scan: ServerScanRequest) -> None:
190190
191191 # Assign the server to scan to a thread pool
192192 assigned_thread_pool_index = self ._get_assigned_thread_pool_index ()
193- assigned_thread_pool = self ._all_thread_pools [assigned_thread_pool_index ]
193+ assigned_thread_pool = self ._thread_pools [assigned_thread_pool_index ]
194194
195195 # Convert each scan command within the server scan request into jobs
196196 queued_futures_per_scan_command : Dict [ScanCommandType , Set [Future ]] = {}
@@ -301,9 +301,9 @@ def get_results(self) -> Iterable[ServerScanResult]:
301301
302302 def _shutdown_thread_pools (self ) -> None :
303303 self ._queued_server_scans = []
304- for thread_pool in self ._all_thread_pools :
304+ for thread_pool in self ._thread_pools :
305305 thread_pool .shutdown (wait = True )
306- self ._all_thread_pools = []
306+ self ._thread_pools = []
307307
308308 # Force garbage collection because for some reason the Future objects created by ThreadPoolExecutor.submit()
309309 # take a ton of memory (compared to what they do - holding a function to call and its arguments):
0 commit comments