From 367225e4e84998e664bed8fabc4c7f159a1c49e1 Mon Sep 17 00:00:00 2001 From: Andrew-Chen-Wang Date: Tue, 24 Mar 2020 21:46:40 -0400 Subject: [PATCH] Removed the 4 workers from the production start of uvicorn --- {{cookiecutter.project_slug}}/compose/local/django/start | 2 +- {{cookiecutter.project_slug}}/compose/production/django/start | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/{{cookiecutter.project_slug}}/compose/local/django/start b/{{cookiecutter.project_slug}}/compose/local/django/start index 259e7cd1..129266c8 100644 --- a/{{cookiecutter.project_slug}}/compose/local/django/start +++ b/{{cookiecutter.project_slug}}/compose/local/django/start @@ -6,7 +6,7 @@ set -o nounset python manage.py migrate -{%- if cookiecutter.use_async %} +{%- if cookiecutter.use_async == 'y' %} /usr/local/bin/gunicorn config.asgi --bind 0.0.0.0:8000 --chdir=/app -k uvicorn.workers.UvicornWorker -e DJANGO_SETTINGS_MODULE=config.settings.local --reload {%- else %} python manage.py runserver_plus 0.0.0.0:8000 diff --git a/{{cookiecutter.project_slug}}/compose/production/django/start b/{{cookiecutter.project_slug}}/compose/production/django/start index 96c8987c..1a41ed48 100644 --- a/{{cookiecutter.project_slug}}/compose/production/django/start +++ b/{{cookiecutter.project_slug}}/compose/production/django/start @@ -27,8 +27,8 @@ if compress_enabled; then python /app/manage.py compress fi {%- endif %} -{% if cookiecutter.use_async %} -/usr/local/bin/gunicorn config.asgi --workers 4 --bind 0.0.0.0:5000 --chdir=/app -k uvicorn.workers.UvicornWorker +{% if cookiecutter.use_async == 'y' %} +/usr/local/bin/gunicorn config.asgi --bind 0.0.0.0:5000 --chdir=/app -k uvicorn.workers.UvicornWorker {% else %} /usr/local/bin/gunicorn config.wsgi --bind 0.0.0.0:5000 --chdir=/app {%- endif %}