Windows production mode command (#570)
This commit is contained in:
parent
977cc6990f
commit
f7a5c99969
@ -77,6 +77,7 @@ BACKEND_HOST = "0.0.0.0"
|
|||||||
TIMEOUT = 120
|
TIMEOUT = 120
|
||||||
# The command to run the backend in production mode.
|
# The command to run the backend in production mode.
|
||||||
RUN_BACKEND_PROD = f"gunicorn --worker-class uvicorn.workers.UvicornH11Worker --preload --timeout {TIMEOUT} --log-level critical".split()
|
RUN_BACKEND_PROD = f"gunicorn --worker-class uvicorn.workers.UvicornH11Worker --preload --timeout {TIMEOUT} --log-level critical".split()
|
||||||
|
RUN_BACKEND_PROD_WINDOWS = f"uvicorn --timeout-keep-alive {TIMEOUT}".split()
|
||||||
|
|
||||||
# Compiler variables.
|
# Compiler variables.
|
||||||
# The extension for compiled Javascript files.
|
# The extension for compiled Javascript files.
|
||||||
|
@ -799,16 +799,33 @@ def run_backend_prod(
|
|||||||
setup_backend()
|
setup_backend()
|
||||||
|
|
||||||
num_workers = get_num_workers()
|
num_workers = get_num_workers()
|
||||||
command = constants.RUN_BACKEND_PROD + [
|
command = (
|
||||||
"--bind",
|
constants.RUN_BACKEND_PROD_WINDOWS
|
||||||
f"0.0.0.0:{port}",
|
+ [
|
||||||
|
"--host",
|
||||||
|
"0.0.0.0",
|
||||||
|
"--port",
|
||||||
|
str(port),
|
||||||
|
"--log-level",
|
||||||
|
loglevel,
|
||||||
|
f"{app_name}:{constants.APP_VAR}",
|
||||||
|
]
|
||||||
|
if platform.system() == "Windows"
|
||||||
|
else constants.RUN_BACKEND_PROD
|
||||||
|
+ [
|
||||||
|
"--bind",
|
||||||
|
f"0.0.0.0:{port}",
|
||||||
|
"--threads",
|
||||||
|
str(num_workers),
|
||||||
|
"--log-level",
|
||||||
|
str(loglevel),
|
||||||
|
f"{app_name}:{constants.APP_VAR}()",
|
||||||
|
]
|
||||||
|
)
|
||||||
|
|
||||||
|
command += [
|
||||||
"--workers",
|
"--workers",
|
||||||
str(num_workers),
|
str(num_workers),
|
||||||
"--threads",
|
|
||||||
str(num_workers),
|
|
||||||
"--log-level",
|
|
||||||
str(loglevel),
|
|
||||||
f"{app_name}:{constants.APP_VAR}()",
|
|
||||||
]
|
]
|
||||||
subprocess.run(command)
|
subprocess.run(command)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user