Added thread_num
This commit is contained in:
8
start.py
8
start.py
@@ -23,6 +23,8 @@ parser = argparse.ArgumentParser()
|
||||
parser.add_argument('--port', "-p", type=int, required=False, help='Port where open the web service of the firewall', default=4444)
|
||||
parser.add_argument('--no-autostart', "-n", required=False, action="store_true", help='Auto-execute "docker-compose up -d --build"', default=False)
|
||||
parser.add_argument('--single-thread', "-s", required=False, action="store_true", help='Disable multi-threaded proxy"', default=False)
|
||||
parser.add_argument('--thread-num', "-t", type=int, required=False, help='Number of threads to use', default=None)
|
||||
|
||||
args = parser.parse_args()
|
||||
sep()
|
||||
puts(f"Firegex", color=colors.yellow, end="")
|
||||
@@ -31,6 +33,8 @@ puts(f"{args.port}", color=colors.cyan)
|
||||
|
||||
os.chdir(os.path.dirname(os.path.realpath(__file__)))
|
||||
|
||||
gcc_params = "-D MULTI_THREAD" if not args.single_thread else ""
|
||||
gcc_params+= f" -D THREAD_NUM={args.thread_num}" if args.thread_num else ""
|
||||
with open("docker-compose.yml","wt") as compose:
|
||||
|
||||
if "linux" in sys.platform and not 'microsoft-standard' in platform.uname().release: #Check if not is a wsl also
|
||||
@@ -43,7 +47,7 @@ services:
|
||||
build:
|
||||
context: .
|
||||
args:
|
||||
- GCC_PARAMS={"-D MULTI_THREAD" if not args.single_thread else ""}
|
||||
- GCC_PARAMS={gcc_params}
|
||||
network_mode: "host"
|
||||
environment:
|
||||
- NGINX_PORT={args.port}
|
||||
@@ -64,7 +68,7 @@ services:
|
||||
build:
|
||||
context: .
|
||||
args:
|
||||
- GCC_PARAMS={"-D MULTI_THREAD" if not args.single_thread else ""}
|
||||
- GCC_PARAMS={gcc_params}
|
||||
ports:
|
||||
- {args.port}:{args.port}
|
||||
environment:
|
||||
|
||||
Reference in New Issue
Block a user