2121from os .path import exists
2222from os .path import join as path_join
2323from sys import exit
24- import logging
2524from rich .progress import Progress
2625import platform
2726
@@ -42,11 +41,11 @@ async def start_run(protocol_obj, args, db, targets):
4241 futures = []
4342 nxc_logger .debug ("Creating ThreadPoolExecutor" )
4443 if args .no_progress or len (targets ) == 1 :
45- with ThreadPoolExecutor (max_workers = args .threads + 1 ) as executor :
44+ with ThreadPoolExecutor (max_workers = args .threads ) as executor :
4645 nxc_logger .debug (f"Creating thread for { protocol_obj } " )
4746 futures = [executor .submit (protocol_obj , args , db , target ) for target in targets ]
4847 else :
49- with Progress (console = nxc_console ) as progress , ThreadPoolExecutor (max_workers = args .threads + 1 ) as executor :
48+ with Progress (console = nxc_console ) as progress , ThreadPoolExecutor (max_workers = args .threads ) as executor :
5049 current = 0
5150 total = len (targets )
5251 tasks = progress .add_task (
@@ -67,29 +66,17 @@ async def start_run(protocol_obj, args, db, targets):
6766
6867def main ():
6968 first_run_setup (nxc_logger )
70- root_logger = logging .getLogger ("root" )
7169 args = gen_cli_args ()
7270
73- if args .verbose :
74- nxc_logger .logger .setLevel (logging .INFO )
75- root_logger .setLevel (logging .INFO )
76- elif args .debug :
77- nxc_logger .logger .setLevel (logging .DEBUG )
78- root_logger .setLevel (logging .DEBUG )
79- else :
80- nxc_logger .logger .setLevel (logging .ERROR )
81- root_logger .setLevel (logging .ERROR )
82- logging .getLogger ("neo4j" ).setLevel (logging .ERROR )
83-
8471 # if these are the same, it might double log to file (two FileHandlers will be added)
8572 # but this should never happen by accident
8673 if config_log :
8774 nxc_logger .add_file_log ()
8875 if hasattr (args , "log" ) and args .log :
8976 nxc_logger .add_file_log (args .log )
9077
91- nxc_logger .debug ("PYTHON VERSION: " + sys .version )
92- nxc_logger .debug ("RUNNING ON: " + platform .system () + " Release: " + platform .release ())
78+ nxc_logger .debug (f "PYTHON VERSION: { sys .version } " )
79+ nxc_logger .debug (f "RUNNING ON: { platform .system ()} Release: { platform .release ()} " )
9380 nxc_logger .debug (f"Passed args: { args } " )
9481
9582 # FROM HERE ON A PROTOCOL IS REQUIRED
0 commit comments