Skip to content

Commit

Permalink
respect env NWORKERS
Browse files Browse the repository at this point in the history
  • Loading branch information
tschaume committed Nov 29, 2023
1 parent 2d4e181 commit 6426272
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion mpcontribs-api/supervisord/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

DIR = os.path.abspath(os.path.dirname(__file__))
PRODUCTION = int(os.environ.get("PRODUCTION", "1"))
DEFAULT_NWORKERS = 2 if PRODUCTION else 1
NWORKERS = int(os.environ.get("NWORKERS", DEFAULT_NWORKERS))
KG_PORT = 10100

deployments = {}
Expand All @@ -21,7 +23,7 @@
kwargs = {
"production": PRODUCTION,
"deployments": deployments,
"nworkers": 2 if PRODUCTION else 1,
"nworkers": NWORKERS,
"reload": int(not PRODUCTION),
"node_env": "production" if PRODUCTION else "development",
"flask_log_level": "INFO" if PRODUCTION else "DEBUG",
Expand Down
4 changes: 3 additions & 1 deletion mpcontribs-portal/supervisord/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

DIR = os.path.abspath(os.path.dirname(__file__))
PRODUCTION = int(os.environ.get("PRODUCTION", "1"))
DEFAULT_NWORKERS = 2 if PRODUCTION else 1
NWORKERS = int(os.environ.get("NWORKERS", DEFAULT_NWORKERS))

deployments = {}

Expand All @@ -19,7 +21,7 @@
kwargs = {
"production": PRODUCTION,
"deployments": deployments,
"nworkers": 2 if PRODUCTION else 1,
"nworkers": NWORKERS,
"reload": int(not PRODUCTION),
"node_env": "production" if PRODUCTION else "development",
"dd_agent_host": "localhost" if PRODUCTION else "datadog",
Expand Down

0 comments on commit 6426272

Please sign in to comment.