Add package and fix worker class name

This commit is contained in:
Jason Mok 2024-06-01 19:38:42 -04:00
parent 88c0e68a27
commit ca03029d3f
4 changed files with 4 additions and 3 deletions

View File

@ -1,6 +1,6 @@
release: python manage.py migrate
{%- if cookiecutter.use_async == "y" %}
web: gunicorn config.asgi:application -k uvicorn-worker.UvicornWorker
web: gunicorn config.asgi:application -k uvicorn_worker.UvicornWorker
{%- else %}
web: gunicorn config.wsgi:application
{%- endif %}

View File

@ -28,7 +28,7 @@ if compress_enabled; then
fi
{%- endif %}
{%- if cookiecutter.use_async == 'y' %}
exec /usr/local/bin/gunicorn config.asgi --bind 0.0.0.0:5000 --chdir=/app -k uvicorn-worker.UvicornWorker
exec /usr/local/bin/gunicorn config.asgi --bind 0.0.0.0:5000 --chdir=/app -k uvicorn_worker.UvicornWorker
{%- else %}
exec /usr/local/bin/gunicorn config.wsgi --bind 0.0.0.0:5000 --chdir=/app
{%- endif %}

View File

@ -106,7 +106,7 @@ function imgCompression() {
function asyncRunServer() {
const cmd = spawn(
'gunicorn',
['config.asgi', '-k', 'uvicorn-worker.UvicornWorker', '--reload'],
['config.asgi', '-k', 'uvicorn_worker.UvicornWorker', '--reload'],
{stdio: 'inherit'},
);
cmd.on('close', function (code) {

View File

@ -24,6 +24,7 @@ flower==2.0.1 # https://github.com/mher/flower
{%- endif %}
{%- if cookiecutter.use_async == 'y' %}
uvicorn[standard]==0.30.0 # https://github.com/encode/uvicorn
uvicorn-worker==0.2.0 # https://github.com/Kludex/uvicorn-worker
{%- endif %}
# Django